-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
61 lines (47 loc) · 1.29 KB
/
justfile
File metadata and controls
61 lines (47 loc) · 1.29 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
# justfile for mvln
set shell := ["bash", "-c"]
# Default recipe
default: pre-commit
# ---------- Main Entry Points ----------
# Run all checks before commit
pre-commit:
just fmt
just clippy
just test
# CI checks (format check, not auto-fix)
ci:
just fmt-check
just clippy
just test
# ---------- Internal Steps ----------
# Format all code and stage modified .rs files
fmt:
cargo fmt --all
git diff --name-only | grep '\.rs$' | xargs -r git add
# Check formatting without modifying (CI-friendly)
fmt-check:
cargo fmt --all -- --check
# Run clippy
clippy:
cargo clippy --all-features -- -D warnings
# Run all tests
test:
cargo test --all-features
# ---------- Parameterized Commands ----------
# Run tests for a specific pattern
test-filter pattern:
cargo test --all-features -- {{pattern}}
# ---------- Git Hooks ----------
# Install git hooks
hooks-install:
@echo "Installing git hooks..."
@mkdir -p .git/hooks
@echo '#!/bin/bash' > .git/hooks/pre-commit
@echo 'exec ./scripts/pre-commit.sh' >> .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@chmod +x scripts/pre-commit.sh
@echo "✓ Pre-commit hook installed"
# Uninstall git hooks
hooks-uninstall:
@rm -f .git/hooks/pre-commit
@echo "✓ Pre-commit hook removed"