Skip to content

.pre-commit-config.yaml doesn't run check_broken_links.py or check_explainer_count.py, unlike CI #421

Description

@yakew7

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.pyOK: 1269 internal links...; python3 scripts/check_explainer_count.pyOK: 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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions