Skip to content

Generated-file list is maintained by hand in five places #30

Closed

Description

@TMHSDigital

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-11
  • scripts/check-public-repo-hygiene.py:13-22 (FORBIDDEN_TRACKED_PATHS)
  • .markdownlint-cli2.jsonc:3-9 (ignores)
  • mkdocs.yml:52-58 (git-revision-date-localized exclude)
  • 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

  1. In check-public-repo-hygiene.py, build the forbidden list from catalog.SECTIONS (import it the way prepare-mkdocs.py does) instead of a literal tuple.
  2. Add a unit test that reads .gitignore, .markdownlint-cli2.jsonc, and mkdocs.yml and checks that each contains every generated path. The test fails when a new section is added without updating them.
  3. Optionally use a pattern such as docs/*/index.md in .gitignore and 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

  1. added
    good first issue
    tech-debt
    severity: low
    on Nov 15, 2026
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

    good first issueseverity: lowtech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions