Repository navigation
Description
Summary
The list of generated files (the home page, four section indexes, and docs/CONTRIBUTING.md) is typed out by hand in five places. Adding a new docs section means editing all five, and missing one fails silently.
Where
.gitignore:5-11scripts/check-public-repo-hygiene.py:13-22(FORBIDDEN_TRACKED_PATHS).markdownlint-cli2.jsonc:3-9(ignores)mkdocs.yml:52-58(git-revision-date-localizedexclude)scripts/catalog.py:15(SECTIONS, the actual source of the section list)
Details
catalog.SECTIONS decides which docs/<folder>/index.md files prepare-mkdocs.py writes. The other four files repeat those paths by hand. If someone adds a fifth section to SECTIONS and forgets, for example, .gitignore, the generated index can be committed. If they forget the hygiene list, CI will not catch it.
Impact
Low today, since sections rarely change, but every new section needs five coordinated edits with no check that they match.
Suggested fix
- In
check-public-repo-hygiene.py, build the forbidden list fromcatalog.SECTIONS(import it the wayprepare-mkdocs.pydoes) instead of a literal tuple. - Add a unit test that reads
.gitignore,.markdownlint-cli2.jsonc, andmkdocs.ymland checks that each contains every generated path. The test fails when a new section is added without updating them. - Optionally use a pattern such as
docs/*/index.mdin.gitignoreand the markdownlint ignores.
Acceptance criteria
- The hygiene script derives its generated-path list from
catalog.py. - A test fails if any of the config files misses a generated path.
Getting started
- Relevant files:
scripts/check-public-repo-hygiene.py,scripts/catalog.py,scripts/test_catalog.py - How to run tests:
python -m unittest scripts.test_catalog
Filed by repo-audit/full-audit at 79cb5dc. Severity: low. Effort: S. audit-key: tech-debt|scripts/check-public-repo-hygiene.py|FORBIDDEN_TRACKED_PATHS
Activity