Pre-Commit Hooks
This project uses prek as the pre-commit hook runner. Do NOT use pre-commit run — always use prek run.
Running Hooks
Run all hooks across all files:
prek run --all-files
Run hooks on specific files:
prek run --files path/to/file.rs
Run hooks on files changed since last commit:
prek run --last-commit
When to Run
Always run prek run --all-files after implementing code and before committing, as part of the STDD workflow:
- Tests pass (GREEN)
- Run
prek run --all-files← here - Fix any issues raised
- Commit
Installing Hooks
On a fresh checkout, install the git hooks with:
just setup
Which runs:
prek install
prek install --hook-type commit-msg
prek install --hook-type pre-push
Hook Stages
Hooks are split across two stages:
- pre-commit (
prek install): formatting, linting, style checks — run on every commit - pre-push (
prek install --hook-type pre-push): heavier checks likecargo deny— run on push