-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjustfile
49 lines (41 loc) · 1.02 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
# Lists all targets
default:
just --list
lint:
cargo clippy --all-targets --no-deps
# Runs the tests
test *ARGS:
#!/usr/bin/env bash
if command -v cargo-nextest; then
COMMAND=(cargo nextest run)
else
COMMAND=(cargo test)
fi
COMMAND+=(--no-fail-fast "$@")
echo "${COMMAND[*]}"
"${COMMAND[@]}"
# Formats all the Markdown, Rust, Nix etc
fix-format: fix-format-prettier
cargo fmt --all
! command -v nix || nix fmt
# Formats Markdown, etc with prettier
fix-format-prettier:
npx --yes prettier --write .
# Runs the tests and updates all goldenfiles with the test output
update-golden-files:
UPDATE_GOLDENFILES=1 just test
just fix-format-prettier
build-docs:
#!/usr/bin/env bash
cd specification
BUILD_OUTPUT=$(mdbook build 2>&1)
if echo "$BUILD_OUTPUT" | grep -q '\[ERROR\]'; then
echo "Build failed with errors:"
echo "$BUILD_OUTPUT"
exit 1
else
echo "Build completed successfully."
fi
# Starts the ndc-spec documentation webserver
start-docs:
cd specification && mdbook serve