build: add pre-commit hook for cargo fmt + clippy
Version-controlled `.githooks/pre-commit` runs `cargo fmt --all -- --check`
and `cargo clippy --all-targets --all-features -- -D warnings` whenever
a commit touches any `.rs` file. Non-Rust commits skip the hook and are
not slowed down.
`scripts/install-hooks.sh` wires `core.hooksPath` to `.githooks` — run
once per clone. Zero external dependencies (no pre-commit framework,
no husky, no lefthook).
Verified: unformatted module change is blocked with a diff and an
actionable "run `cargo fmt --all` and re-stage" message.
Closes #5
SHA:
3df754cdfacbc228d36b503914cb87c914d30acd
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-20 03:11
Parents:
04c8e1b
2 files changed
+37
-0
| Type | ||
|---|---|---|
|
|
scripts/install-hooks.sh | +13 −0 |
|
||