-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
113 lines (86 loc) · 2.65 KB
/
justfile
File metadata and controls
113 lines (86 loc) · 2.65 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# justfile for novalyn development
tools := "cargo-nextest cargo-deny cargo-audit cargo-llvm-cov cargo-watch cargo-insta"
# Commands
format := "cargo fmt --all"
clippy := "cargo clippy --all-targets --all-features --workspace"
coverage := "cargo llvm-cov --all-features --workspace"
build := "cargo build --all --locked"
nextest := "cargo nextest run --all-features --workspace --locked"
# Default recipe (shows help)
_default:
@just --list
# Format code with rustfmt
fmt:
{{ format }}
# Check code formatting
fmt-check:
{{ format }} -- --check
# Run clippy linter
lint:
{{ clippy }} -- -D warnings
# Run clippy linter and autofix
lint-fix:
{{ clippy }} --fix -- -D warnings
# Build the project
build:
{{ build }}
# Build release version
build-release:
{{ build }} --release
# Run tests with nextest
test *FLAGS:
{{ nextest }} {{ FLAGS }}
cargo test --doc --locked --workspace
# Run tests without doc tests
test-fast:
{{ nextest }}
# Run benchmarks
bench:
cargo bench
# Generate documentation
doc:
cargo doc --all --no-deps --open
# Run all checks (format, lint, test)
check: fmt-check lint test
# Run pre-commit checks
pre-commit: fmt lint test deny
@echo "{{ GREEN + BOLD }}✅ All pre-commit checks passed!{{ NORMAL }}"
# Run cargo-deny checks
deny:
cargo deny check
# Run security audit
audit:
cargo audit
# Install development tools using cargo-binstall
install-tools:
@echo "{{ BLUE + BOLD }}Installing development tools...{{ NORMAL }}"
cargo binstall -y {{ tools }} || cargo install cargo-binstall && cargo binstall -y {{ tools }}
@echo "{{ GREEN + BOLD }}✅ Tools installed!{{ NORMAL }}"
# Install git pre-commit hook (run with just pre-commit)
install-hook:
@echo -e "#!/bin/sh\njust pre-commit" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "{{ GREEN + BOLD }}✅ Pre-commit hook installed!{{ NORMAL }}"
# Clean build artifacts
clean:
cargo clean
# Generate coverage report (text summary)
coverage:
{{ coverage }}
# Generate HTML coverage report and open in browser
coverage-html:
{{ coverage }} --html --open
# Generate lcov.info for Codecov (matches CI workflow)
coverage-lcov:
{{ coverage }} --lcov --output-path lcov.info
@echo "{{ GREEN + BOLD }}✅ Coverage report saved to lcov.info{{ NORMAL }}"
# Clean coverage data
coverage-clean:
cargo llvm-cov clean
# Watch for changes and run tests
watch:
cargo watch -x 'clippy -- -D warnings' -x 'nextest run'
# Create a release build and run the binary
release:
cargo build --release
@echo "{{ BLUE + BOLD }}Release binary:{{ NORMAL }} {{ UNDERLINE + CYAN }}target/release/novalyn{{ NORMAL }}"