You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DO NOT MERGE until #3630] Unify contributor pre-commit setup + docs (#3631)
> [!WARNING]
> **Draft — merge last.** Merge order: **#3629 → #3630 → this PR.**
> This branch is stacked on #3629, so #3629's commits appear in this
diff until it merges (then the diff collapses to this PR's three
commits). It must also land after #3630 because the docs describe the
SCSS/stylelint hook that #3630 adds.
Fixes a gap in the local contributor setup: following the documented
steps left the pre-commit **framework** checks not running locally, so
lint/secret/spell issues surfaced only in CI.
## The problem
`setup-hooks.sh` runs `git config core.hooksPath .githooks`. Once
`core.hooksPath` is set, git looks **only** there and ignores
`.git/hooks` — which is where `pre-commit install` puts its hook. So the
two documented setup steps conflict: `pre-commit install` even refuses
to run (`Cowardly refusing to install hooks with core.hooksPath set`),
and the framework checks never fired locally. `.githooks/pre-commit`
only stamped dates.
## The fix
**One hook runs everything.** `.githooks/pre-commit` now stamps content
dates (as before), then invokes `pre-commit run` on the staged files.
Contributors run a single setup — install the `pre-commit` binary and
run `./setup-hooks.sh`; no `pre-commit install`. If the binary isn't
installed, the hook stamps dates and prints a reminder rather than
failing.
Also in this PR:
- **README + contributor hook guide rewritten** for the single setup
path, with SCSS/stylelint added to the list of checks.
- **Corrected tag validation from "blocking" to advisory** in both docs
— `scripts/hooks/content_checks.py` tags mode always returns 0 (warns,
never blocks). The old guide's "commit blocked due to tag errors"
example was fiction.
- **Fixed an invalid `margin-left: 0 em`** in `.docs-content`
(`_custom.scss`) — the stray space made the declaration invalid, so the
intended zero margin never applied. (The out-of-scope item spotted
during DOCS-78.)
## Verification
- Ran real commits with `core.hooksPath=.githooks`: the hook stamps
dates **and** runs the full framework (previously it ran neither the
framework nor blocked). Confirmed the framework's per-hook table appears
and a clean tree passes.
- markdownlint (via the hook) passes on the rewritten docs.
- Empirically reproduced the original conflict: `pre-commit install`
refuses when `core.hooksPath` is set.
---
Created in collaboration with Claude Code running Opus 4.8 on
2026-07-23.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments