Expand description
The three Rust hooks: cargo fmt --check, cargo clippy, cargo test.
Scoped like every other language hook — they fire only when the commit (or
push) touches Rust, and only in a directory that actually has a Cargo.toml.
A Python repo never invokes cargo.
Split across the two dispatchers by COST, matching what the other languages
already do: fmt and clippy are pre-commit (as ruff and pyright are),
test is pre-push (as run-tests-js is). Nobody wants to wait for a
workspace test run on every commit.
Each is a separate check rather than one “rust” hook, so hook.skip can
disable them individually — git config hook.skip clippy when you are
mid-refactor, without losing the formatting gate.
Constants§
- EXTS
- What
cargo fmtis handed. Exported soregistry.rsdeclares the scope from the same constant — seelint_json_yaml::EXTS. - RUST_
PATHS - Files that mean “this commit touches Rust”.
Cargo.tomlandCargo.lockcount: a dependency bump compiles differently without a single.rsedit, and that is exactly when clippy earns its keep.