Where: .pre-commit-config.yaml vs Makefile's lint/build-explainers targets and their matching CI workflows.
The gap: .pre-commit-config.yaml hooks check_em_dash.py, ruff, build_explainers.py, generate_og_images.py, and the full pytest suite - but has no hook for scripts/check_broken_links.py (part of make lint, run by lint.yml on every push/PR) or scripts/check_explainer_count.py (run by build-explainers.yml's explainer-count-drift step).
Repro:
grep -n "check_broken_links\|check_explainer_count" .pre-commit-config.yaml
returns no matches, while both scripts are real, currently-passing checks (python3 scripts/check_broken_links.py → OK: 1269 internal links...; python3 scripts/check_explainer_count.py → OK: all 5 explainer-count mentions match...).
Why it matters: CONTRIBUTING.md recommends pre-commit install specifically so local hooks "reproduce what CI runs" before a contributor pushes - a contributor who adds a broken internal markdown link, or adds/removes an explainer without updating the count mentions in README/CONTRIBUTORS/METRICS/ROADMAP, gets a clean local pre-commit run and only discovers the failure in CI.
Suggested fix: add local hooks for both scripts, scoped the same way CI scopes them (broken-links on *.md changes, explainer-count on explainers/** or the four docs files changing).
Where:
.pre-commit-config.yamlvsMakefile'slint/build-explainerstargets and their matching CI workflows.The gap:
.pre-commit-config.yamlhookscheck_em_dash.py,ruff,build_explainers.py,generate_og_images.py, and the fullpytestsuite - but has no hook forscripts/check_broken_links.py(part ofmake lint, run bylint.ymlon every push/PR) orscripts/check_explainer_count.py(run bybuild-explainers.yml's explainer-count-drift step).Repro:
returns no matches, while both scripts are real, currently-passing checks (
python3 scripts/check_broken_links.py→OK: 1269 internal links...;python3 scripts/check_explainer_count.py→OK: all 5 explainer-count mentions match...).Why it matters:
CONTRIBUTING.mdrecommendspre-commit installspecifically so local hooks "reproduce what CI runs" before a contributor pushes - a contributor who adds a broken internal markdown link, or adds/removes an explainer without updating the count mentions in README/CONTRIBUTORS/METRICS/ROADMAP, gets a clean local pre-commit run and only discovers the failure in CI.Suggested fix: add local hooks for both scripts, scoped the same way CI scopes them (broken-links on
*.mdchanges, explainer-count onexplainers/**or the four docs files changing).