Fix docs drift, shared regex literals, CI wording and redefined loop variables, with the gates that would have caught them

Open
#608 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing, tooling

Research direction

Start with docs/architecture.md and the listed definitions in c_family/layout.py, c_family/sanitizers.py, cmake/syntax.py, autotools/configure_syntax.py, facts/shell_values.py, and facts/expansion.py; inspect the existing tests and Ruff configuration. Implement the documented checks and fixes across the named files, then run the test suite. Done means all fixes land and each requested gate runs in tests.

Written by the indexing model from the issue text.

Description

Fixes

  • docs/architecture.md:45 names pretty.py, which no longer exists.
  • Duplicated regex literals: the CMake truthy set (c_family/layout.py:23, c_family/sanitizers.py:23), the identifier regex (cmake/syntax.py:74, autotools/configure_syntax.py:20), and $VAR/${VAR} (facts/shell_values.py:369, facts/expansion.py:359).
  • Wording: "found in CI configuration" (9 times) becomes "found in what CI runs" (1 time today), with the snapshots.
  • PLW2901: 7 redefined loop variables.

Gates

  • A docs drift test: every *.py, *.toml or project_validator/... path named in docs/*.md and the README must exist, with a short allowlist for user-facing examples.
  • ruff PLW2901, PLR1714 (2 hits today) and PLW0603 (0).
  • SLF001 for tests/ as a count that may only fall, starting at 43.
  • A duplicate-definition AST check: a name bound twice in one module or class body fails (skipping @overload, property setters and if TYPE_CHECKING).

Done when

All fixes land and every gate runs in the test suite.

Split from #543. Checked against main at 4b4dbb6c on 2026-12-03: the cases above were reproduced with small fixtures or found in the code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Dominant language
Python
Stars
4
Forks
1
Avg merge
6h 31m
Merged PRs (30d)
238

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cpp-best-practices/project_validator

All issues in cpp-best-practices/project_validator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.