# Developing
Run `prek install` once; it wires both the pre-commit and the commit-msg stage,
and until someone runs it a commit here is checked by nobody. The pre-commit
stage runs `cargo fmt`, `cargo clippy` and `cargo doc` across the whole
workspace, so against a cold `target/` it is minutes, and `cargo doc` is wired
to `docs/*.md` as well as to the Rust sources, so a documentation-only commit
pays for it too. Against a warm one it is seconds.
Keeping it seconds is what `scripts/lint.sh` is for: lint by hand with that
rather than a bare `cargo clippy`. Cargo caches a check against the flags it
was given, so the two are separate cached results over the same source, and
alternating between them re-checks every crate in the workspace each way.
The commit-msg stage checks that the subject is a Conventional Commit and
stamps the `Change-Id` trailer that stacked pull requests are matched by; that
trailer is what a `--no-verify` commit gives up along with the checks, and a
commit made without one has to be rewritten to get one.
The test suite runs from `scripts/ci.sh []`: it runs the hooks over every
file rather than a staged set, replays the commit-msg stage over every commit in
`..HEAD`, checks that brand images are up to date via
`scripts/build-brand.sh --check`, and then runs `cargo test --workspace --all-features`. A branch
is checked when a person runs it.