-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
160 lines (120 loc) · 4.38 KB
/
Copy pathJustfile
File metadata and controls
160 lines (120 loc) · 4.38 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
set positional-arguments
export RUSTDOCFLAGS := "-D warnings"
_:
@just help
# Install required rustup components and fetch dependencies
setup:
rustup component add clippy rustfmt
cargo fetch
# Make a current stable toolchain available for compiling repository tools
_stable-tools:
rustup toolchain install stable --profile minimal
# Install cargo-nextest
install-nextest: _stable-tools
cargo +stable install --locked cargo-nextest
# Install cargo-llvm-cov and its rustup component
install-coverage-tool: _stable-tools
rustup component add llvm-tools-preview
cargo +stable install --locked cargo-llvm-cov
# Install cargo-deny
install-deny-tool: _stable-tools
cargo +stable install --locked cargo-deny
# Install typos-cli
install-spell-tool: _stable-tools
cargo +stable install --locked typos-cli
# Install cargo-hack
install-feature-tool: _stable-tools
cargo +stable install --locked cargo-hack
# Install all optional repository tools
install-tools: install-nextest install-coverage-tool install-deny-tool install-spell-tool install-feature-tool
# Format all Rust targets
format:
cargo fmt --all
cargo +stable fmt --manifest-path lint/Cargo.toml
cargo +stable fmt --manifest-path fuzz/Cargo.toml
# Compile every workspace target and feature
check-code:
cargo check --workspace --all-targets --all-features
# Run Clippy with warnings treated as errors
lint:
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Apply safe Clippy fixes to tracked and staged work
fix:
cargo clippy --workspace --all-targets --all-features --fix --allow-dirty --allow-staged
# Pass Cargo and libtest arguments after the recipe name, for example: just test -- --nocapture
# Run unit, integration, and documentation tests
test *args:
cargo test --workspace --all-features {{args}}
# Nextest does not run documentation tests; check-all runs them separately for library crates.
# Run unit and integration tests with cargo-nextest
nextest *args:
cargo nextest run --workspace --all-features {{args}}
# Run only rustdoc examples
doctest:
cargo test --workspace --all-features --doc
# Check default, no-default, individual, and shallow feature combinations
features:
cargo hack check --workspace --feature-powerset --depth 1 --all-targets
# Generate an HTML source coverage report
coverage:
cargo llvm-cov --workspace --all-features --html
# Generate an LCOV coverage file
coverage-lcov:
cargo llvm-cov --workspace --all-features --lcov --output-path lcov.info
# Build a debug version
build:
cargo build --workspace --all-features
# Build an optimized release version
release:
cargo build --workspace --all-features --release
# Build API documentation and reject rustdoc warnings
docs-check:
cargo doc --workspace --all-features --no-deps
# Build API documentation
docs: docs-check
# Check dependency advisories, licenses, bans, and sources
deny:
cargo deny check
# Check prose and identifiers for common misspellings
spell:
typos
# Install the repository's pre-commit hooks
hooks:
pre-commit install
# Remove Cargo build artifacts
clean:
cargo clean
# Run the built-in non-mutating quality gate
check: check-code lint test test-driver static-check docs-check
cargo fmt --all -- --check
cargo +stable fmt --manifest-path lint/Cargo.toml -- --check
cargo +stable fmt --manifest-path fuzz/Cargo.toml -- --check
# Run the broader tool-assisted quality gate
check-all: check-code lint nextest doctest test-driver static-check features docs-check deny spell
cargo fmt --all -- --check
cargo +stable fmt --manifest-path lint/Cargo.toml -- --check
cargo +stable fmt --manifest-path fuzz/Cargo.toml -- --check
# List available commands
help:
@just --list
alias fmt := format
alias cov := coverage
alias dev := setup
alias qa := check
alias test-fast := nextest
# Test the native transaction driver with explicit Cargo process doubles
test-driver:
cargo build -p cargo-statement-spacing --locked
python3 -m unittest discover -s crates/cli/tests -v
# Check source and configuration integrity
static-check:
cargo run -p source-policy --locked
# Exercise the installed native consumer without relying on the source checkout
test-installed:
python3 scripts/validate.py --portable-only
# Install the pinned Dylint toolchain and build the compiler plugin
setup-dylint:
bash scripts/bootstrap.sh
# Exercise real Dylint checks and native/verified fixes
validate:
python3 scripts/validate.py