-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
66 lines (52 loc) · 1.49 KB
/
justfile
File metadata and controls
66 lines (52 loc) · 1.49 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# List available recipes
default:
@just --list
# Run all checks (test, lint, fmt, audit, doc, licenses, udeps)
check: test lint fmt-check audit doc check-licenses check-udeps
# Fix all auto-fixable issues
fix: fix-clippy fix-fmt fix-audit fix-cargo
# Run tests
test:
cargo test --all-features --all-targets
# Run clippy lints
lint:
cargo clippy --all-features --all-targets -- -D warnings
# Check formatting
fmt-check:
cargo fmt --check --all
# Run cargo audit
audit:
cargo audit
# Build documentation
doc:
cargo doc --all-features
# Check licenses (logic ported from check.sh)
check-licenses:
@echo "Checking licenses..."
@# The grep command will exit with 0 if it finds matching lines (bad licenses),
@# and 1 if it finds no matches (all licenses are good).
@# We want to fail (exit 1) if grep finds matches.
@if cargo license | grep -v -E "((MIT)|(Apache-2.0)|(BSD-[23]))"; then \
printf "\033[31m ERROR: Disallowed licenses detected above\033[0m\n"; \
exit 1; \
else \
echo "License check passed."; \
fi
# Check unused dependencies (requires nightly/RUSTC_BOOTSTRAP)
check-udeps:
RUSTC_BOOTSTRAP=1 cargo udeps
# Fix clippy issues
fix-clippy:
cargo clippy --all-targets --all-features --fix --allow-dirty
# Format code
fix-fmt:
cargo fmt --all
# Fix audit issues
fix-audit:
cargo audit fix
# Run cargo fix
fix-cargo:
cargo fix --all-targets --all-features --allow-dirty
# Run benchmarks
bench:
cargo bench