From 66c8ade7455471b3518226ea2a44dbbcc812f7be Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Thu, 3 Sep 2026 05:44:25 -0400 Subject: [PATCH] docs(readme): correct which hooks fire on what, and which run tests `cargo fmt` runs on `.rs` alone and `cargo doc` also on `docs/*.md`, so a docs-only commit pays the expensive hook; and the lexicon tests are not the only tests a hook runs, since `build-site.sh` and `test-publish-site.sh` both run suites of their own. Change-Id: Ibe45ea4fa1d9af4e82f248c5f59ec582fa945460 --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 572f3e46..0659dcfc 100644 --- a/README.md +++ b/README.md @@ -90,19 +90,25 @@ pre-commit stage runs file hygiene (merge markers, large files, YAML/TOML/JSON parsing, line endings, trailing whitespace) on every commit, and then, only when a commit touches the files each cares about: -- `cargo fmt --all`, `cargo clippy --workspace --all-targets --all-features -- -D warnings` - and `cargo doc --workspace --no-deps --all-features --document-private-items` - on any `.rs`, `Cargo.toml` or `Cargo.lock` change. Both cargo hooks act on - the whole workspace, and `.cargo/config.toml` sets `-D warnings` for rustdoc - too, so this is where the wait is — minutes, and longer against a cold - `target/`. That is what a `--no-verify` commit gives up. +- `cargo fmt --all` on a `.rs` change; + `cargo clippy --workspace --all-targets --all-features -- -D warnings` on a + `.rs`, `Cargo.toml` or `Cargo.lock` change; and + `cargo doc --workspace --no-deps --all-features --document-private-items` on + those plus `docs/*.md` and `.cargo/config.toml`, since the prose pages are + `include_str!`'d into the doc build. All three act on the whole workspace + whatever they are handed, and `.cargo/config.toml` sets `-D warnings` for + rustdoc too, so this is where the wait is — minutes, and longer against a + cold `target/`. A commit touching only `docs/*.md` pays it. That is what a + `--no-verify` commit gives up. - `scripts/doc-lint.sh` on `docs/*.md`, `scripts/check-plan.py` and `scripts/gen-plan-readme.py --check` on `plan/*`, `bash -n` on `scripts/*.sh`, - and `scripts/test-publish-site.sh` on the publish scripts. + and `scripts/test-publish-site.sh` on the publish scripts — that last one is + a test run too, against a stubbed `aws`. - `cargo test -p didbot-lexicon --all-features` on a `lexicons/*.json` change. - This is the only test run any hook makes. + This is the only Rust test any hook runs. - `scripts/build-site.sh` on `site/`, `docs/*.md` or `crates/didbot-site-anim/`. - It assumes `site/node_modules` already exists. + It assumes `site/node_modules` already exists, and it ends by running + `site/tests` — so a `docs/*.md` commit runs those too. The commit-msg stage runs `committed` against `committed.toml`, so a subject that is not a Conventional Commit is rejected as it is written, and stamps a -- 2.51.2