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

Đang mở
#608 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
testing, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
6 giờ 31 phút
Pull request đã merge (30 ngày)
238

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.