python/cpython

cpython's structural validation is scattered across 12 distinct surfaces — 122 Make targets, 35 pre-commit hooks, 9 ruff configs, 7 Tools/build/* check scripts. alint consolidates the declarative orchestration into one 72-rule config.

Narrative
Replaces N hand-rolled validation scripts
Rules
72
Last revalidated
Engineering reference
README on GitHub · .alint.yml

Why this case study matters

cpython is the canonical Python+C hybrid mega-repo. Unlike rust-lang/rust (which packages structural validation as one Rust binary, tidy), or kubernetes (which uses ~50 hack/verify-*.sh scripts), cpython’s structural validation is scattered across 12 distinct surfaces: a 122-target Makefile.pre.in, a 35-hook .pre-commit-config.yaml, 7 Tools/build/*.py check scripts, Tools/c-analyzer/check-c-globals.py, Tools/check-c-api-docs/main.py, Tools/patchcheck/patchcheck.py, a 4747-byte .gitattributes (with ~50 generated-file markers), .editorconfig, Misc/stable_abi.toml, the per-tree .ruff.toml files, the .azure-pipelines/prebuild-checks.yml embedded shell, and 25 GitHub Actions workflows.

A new contributor staring at this surface today has to read 122 Make targets, 35 pre-commit hooks, 7+ Tools/build/* scripts, the Azure Pipelines YAML, the .gitattributes file, two LOCAL pre-commit shell hooks, and 9 separate .ruff.toml configs to understand what rules apply where.

Headline catch

The most alint-shaped surface in cpython is Misc/NEWS.d/next/<Section>/. 12 category subdirectories holding ~10-200 entries each (108 in Library/ at clone time). Every entry MUST be named:

YYYY-MM-DD-HH-MM-SS.gh-issue-NUMBER.NONCE.rst

The full filename grammar is generated exclusively by the blurb tool. cpython’s existing structural validation encodes only the WEAKER “no spaces in path” invariant on TWO specific subdirs (via two LOCAL pre-commit hooks). The full grammar applies to ALL subdirs and is enforced nowhere statically todayblurb generates it correctly, but a hand-edited filename slips silently through until Sphinx parsing fails at release-build time.

The alint rule (cpython-news-entry-filename) is 6 lines of YAML and covers ALL 12 subdirs. This is the canonical “convention-without-checks” data point: a discipline the entire release pipeline depends on, enforced only by tool-write-time grace.

Where alint earns its keep here

cpython sits at the intersection of all three positioning narratives, which is what makes it uniquely valuable:

The pitch lands as: “we sit beneath your existing linters as the structural-orchestration layer, we collapse the hand-rolled scripts you’ve outgrown, and we surface the conventions your tooling assumes but never checks.”

Future story angles

The factual engineering writeup (tooling inventory, mapping table, gap catalogue, validation status footer) lives in the public alint repo at github.com/asamarts/alint/tree/main/examples/python-cpython/README.md.