-
-
Notifications
You must be signed in to change notification settings - Fork 419
/
justfile
52 lines (41 loc) · 1.65 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# List of commands runnable with https://github.com/casey/just
#
# When adding new recipes, include a one-line comment describing the behavior
# to be displayed by `just --list` next to the name.
_default:
echo "no default recipe; run with --list to see all recipes"
exit 1
generate-jni:
rust/bridge/jni/bin/gen_java_decl.py
generate-ffi:
swift/build_ffi.sh --generate-ffi
generate-node:
rust/bridge/node/bin/gen_ts_decl.py
# Regenerate bridge code for all three app languages.
generate-bridge: generate-jni generate-node generate-ffi
format-jni:
(cd java && ./gradlew spotlessApply)
format-ffi:
(cd swift && swiftformat --swiftversion 5 . --lint)
format-node:
(cd node && npm run format)
# Auto-format code in Java, Rust, Swift, and TypeScript
format-all: format-jni format-ffi format-node
cargo fmt
taplo fmt
# Same as format-all, but does not actually make changes; merely fails if code is not yet formatted.
check-format-all:
cargo fmt --all -- --check
taplo fmt --check
(cd swift && swiftformat --swiftversion 5 . --lint)
(cd node && npm run format-check)
(cd java && ./gradlew spotlessCheck)
# Runs some quick local checks; useful to make sure CI will not fail immediately after push.
check-pre-commit:
just check-format-all
(cd node && npm run lint)
(cd swift && ./verify_error_codes.sh)
(cd swift && swiftlint lint --strict)
cargo test --workspace --all-features --verbose --no-fail-fast -- --include-ignored
cargo clippy --workspace --all-targets --all-features --keep-going -- -D warnings
@printf "\e[32mBasic pre-commit checks passed! ✅ Hopefully good to push! 🤞\e[0m\n"