Repository navigation
Description
Follow-up to #3288 / #3297 (PR #3293 merged). A 5-agent red-team pass after the merge found real gaps the verification command did not catch — the ls ci/lint_cpp/*.py … | grep -vE … proxy only checks for .py files in two directories and missed C++ lint rules living elsewhere, behavioral divergences, and stale references that will mislead future contributors.
Filing as a single issue with prioritized buckets so it can be worked end-to-end or chunked.
CRITICAL — 1 rule still enforced only in Python with no Rust port
ci/tests/test_wasm_clang_format.py
- Rule: every file containing
EM_ASM_undersrc/platforms/wasm/must carry// clang-format off. - Where it runs: pytest auto-collected via
ci/util/test_runner.py(lines 104, 636) on everybash test. - Rust coverage: NONE. The Rust crate has
AsmJsLocationChecker(ci/lint_cpp_rs/src/checkers/preprocessor.rs:355-397) but it enforces a different rule — "EM_ASMmacro must live in.js.cpp.hpp". Theclang-format offrequirement has zero coverage in the Rust crate (rg 'clang-format off' ci/lint_cpp_rs/returns no matches). - Acceptance: either port to Rust as a per-file checker in
ci/lint_cpp_rs/src/checkers/preprocessor.rs(struct +impl FileContentChecker, register in 3 sites), or accept it as Tier-4 and add it to the carve-out list in the architecture doc.
CRITICAL — 3 duplicate rules running both in Rust and in pytest
Each of these re-implements a rule already covered by the Rust crate. Two sources of truth, wasted CI time, and a drift hazard if the rule definitions ever diverge.
ci/tests/test_missing_pragma_once.py↔PragmaOnceChecker(ci/lint_cpp_rs/src/checkers/preprocessor.rs:458)ci/tests/test_no_include_after_namespace.py↔IncludeAfterNamespaceChecker(ci/lint_cpp_rs/src/checkers/style.rs:375)ci/tests/test_wrong_defines.py↔WRONG_DEFINEStable inBannedDefineChecker(ci/lint_cpp_rs/src/checkers/preprocessor.rs:60-70)
Acceptance: delete the three pytest files. The Rust crate already enforces them on every bash lint --cpp (and the CI workflow runs that step).
HIGH — behavioral divergences vs the original Python implementations
PchFileChecker case-sensitivity drift (Linux/macOS over-flags)
- File:
ci/lint_cpp_rs/src/checkers/structural_passes.rs:138 - Python original used
scan_dir.rglob("*.pch")— case-sensitive on Linux/macOS via pathlib. - Rust port uses
ext.eq_ignore_ascii_case("pch")— always case-insensitive. - Repro:
touch tests/build.PCHon Linux → Python silent, Rust emits violation. - Acceptance: switch to exact-case
.pchmatch (or document the stricter behavior as intentional and bump a comment).
_ast_tool_unavailable over-broad — could silently swallow real clang errors
- File:
ci/lint_cpp/run_all_checkers.py:362(the_ast_tool_unavailablehelper added in commit3386dcb3cto make CI tolerate missingclang-tool-chain-query). - Bug: substring-matches
"no such file or directory". That substring also appears in legitimate clang errors — e.g., a missing-Ipath, or a TU#includeing a deleted header on some clang/OS builds. Today, those real failures would now be silently downgraded to a stderr warning with no violation emitted. - Acceptance: tighten the classifier to require co-occurrence with
"clang-query"or"clang-tool-chain-query"in the message; drop the bare"no such file or directory"clause.
MEDIUM — 8 stale doc/config references to deleted Python files
Discovered by rg of every deleted .py basename + checker class name across agents/docs/, .claude/, ci/, src/. These will mislead anyone reading the architecture docs or trying to extend the linter.
| File | Lines | Stale content |
|---|---|---|
agents/docs/linter-architecture.md |
153-168 | Entire "When to still use Python" section names 9 deleted files as live |
agents/docs/cpp-standards.md |
262, 267 | References deleted ci/lint_cpp/public_settings_pattern_checker.py |
.claude/agents/cpp-linter-builder-agent.md |
189 | Templates point at deleted test_unity_build.py / test_aggregation_checker.py / pch_file_checker.py |
.claude/agents/architecture-reviewer-agent.md |
107 | References deleted public_settings_pattern_checker.py |
.claude/commands/code_review.md |
339 | References deleted public_settings_pattern_checker.py |
ci/dependencies.json |
65-74 | tools array lists 9 deleted .py files |
src/fl/stl/compiler_control.h |
336 | Comment references deleted ci/lint_cpp/bare_noinline_checker.py |
ci/fix_has_include_README.md |
37 | References retired has_include_checker.py |
Acceptance: each reference replaced with the live Rust path (ci/lint_cpp_rs/src/checkers/<file>.rs::<Class>) or removed.
MEDIUM — three quiet feature regressions
FL_LINT_AB=1 is now functionally a no-op
- After PR feat(lint): retire Python C++ checkers; Rust fastled-lint is default (#3288) #3293,
create_checkers()inci/lint_cpp/run_all_checkers.py:108-145returns all-empty scope lists. The Python side has nothing to compare against.run_rust_ab_checkruns but its Python canonical set is empty by construction, so parity always passes trivially. - Acceptance: either delete the A/B infrastructure entirely (since there's no Python implementation to compare against anymore) or rewire
FL_LINT_AB=1to compare against a frozen-baseline JSON dump so the parity guard regains meaning.
ci/cpp_lint_cache.py fingerprint omits Rust sources
- The cache file globs (line 38-57) include
ci/lint_cpp/*.pyand the dependencies.json manifest but notci/lint_cpp_rs/src/**/*.rs. - Repro: edit a Rust checker locally without touching any C++ file, run
bash lint. The cache reports "no C++ changes" (stage_impls.py:189, 254-255) and the new Rust logic is never exercised. - Acceptance: add
ci/lint_cpp_rs/Cargo.lock,ci/lint_cpp_rs/Cargo.toml,ci/lint_cpp_rs/src/**/*.rsto the cpp_lint cache include set.
lint-on-save.py:114-117 skips examples/ C++ files entirely
- Several Rust checkers DO apply to examples:
UsingNamespaceFlInExamplesChecker,ExampleSerialChecker, the examples-scope BannedHeadersChecker. None get interactive feedback on save today (CI still catches them). - Acceptance: remove the
examples/short-circuit so on-save lint runs the examples-scope Rust checkers. The fingerprint cache will keep this cheap.
LOW — orphan rule no longer enforced
ci/fix_has_include.py
- 200-line scanner that enforces "every file using
FL_HAS_INCLUDE(...)must#include "fl/stl/has_include.h"". - Has zero callers anywhere in the tree (only
ci/fix_has_include_README.mdmentions it). - No Rust equivalent:
rg 'has_include' ci/lint_cpp_rs/returns no matches. - Acceptance: either port the rule into the Rust crate (it's a simple per-file regex check that fits
basic.rs'sBannedMacrosCheckerneighborhood) and rewireci/fix_has_include.pyto use it, or document that the rule is no longer enforced.
Search proxies for tracking progress
When triaging this issue, use these broader red-team searches (the bash lint-style 3-line check from #3297 misses everything in ci/tests/ and the orphan tools):
# 1. Hunts for C++ lint logic outside the orchestrator + Rust home
rg --files-with-matches -t py 'endswith.*\.(cpp|h|hpp|cc)|rglob.*\.(cpp|h|hpp|cc)' \
ci/ tests/ scripts/ tools/ 2>/dev/null \
| grep -vE 'ci/lint_cpp/(run_all_checkers|rust_binary_cache|rust_bridge)\.py$' \
| grep -vE 'ci/lint_cpp_rs/' \
| grep -vE '__pycache__|\.cache|test_noexcept_checker'
# 2. Hunts for stale references to deleted Python checker basenames
rg 'iwyu_pragma_check|test_unity_build|test_aggregation_checker|public_settings_pattern_checker|pch_file_checker|bare_(libm|noinline|snprintf)_checker|fl_no_underscore_checker|legacy_log_macro_checker|has_include_checker' \
--glob '!.claude/worktrees' --glob '!**/__pycache__' --glob '!**/target' \
--glob '!ci/lint_cpp_rs/**'The first command currently prints ci/tests/test_missing_pragma_once.py, test_no_include_after_namespace.py, test_wasm_clang_format.py, test_wrong_defines.py, ci/fix_has_include.py. The second prints the 8 stale-doc files. Both should print zero lines when this issue is done.
Done When
-
test_wasm_clang_format.pyrule lives in Rust (or is documented as Tier-4 carve-out). - The three duplicate-rule pytest files are deleted.
-
PchFileCheckermatches case-sensitively (Linux parity restored). -
_ast_tool_unavailableno longer matches the bare"no such file or directory"substring. - All 8 stale-doc references updated to point at the Rust crate or removed.
-
FL_LINT_AB=1either deleted or rewired against a frozen baseline. -
cpp_lint_cache.pyfingerprint includesci/lint_cpp_rs/src/**/*.rs. -
lint-on-save.pyruns Rust examples-scope checkers onexamples/saves. -
ci/fix_has_include.pyis either retired (and its rule ported to Rust) or kept with a documented caller path. - Both
rgproxies above print zero lines.
Related
- Mandatory C++ linter migration: Rust-only via build-on-change cache, retire Python checkers #3288 — initial Rust C++ linter migration.
- Finish #3288 migration: retire remaining single-file Python C++ checkers (Tier 1-3) #3297 — Tier 1-3 retirement follow-up (closed).
- PR feat(lint): retire Python C++ checkers; Rust fastled-lint is default (#3288) #3293 — merged, carried the bulk of the migration.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
docs: address CodeRabbit — clarify AST ratchet count
refactor(lint): port EM_ASM clang-format pytest to Rust; drop 3 dupli…
fix(lint): #3308 small fixes (PchFileChecker case-sensitivity, _ast_t…
docs: #3308 retire stale references to deleted Python C++ checkers (#…
fix(lint): #3308 small fixes — PchFileChecker case-sensitivity, _ast_…
zackees commentedon Jun 20, 2026
Closed: all 9 acceptance checkboxes satisfied across 3 merged PRs.
Merged
45474b5c4) — docs: retire stale references to deleted Python C++ checkers — 8 stale doc refs +fix_has_include.pydocstring +ci/dependencies.jsonprune.493e9a28b) — refactor: port EM_ASM clang-format pytest to Rust; drop 3 duplicate pytests — newEmAsmClangFormatChecker+ deleted the 3 duplicate-rule pytests (and the now-redundanttest_wasm_clang_format.py).5f5813610) — fix: PchFileChecker case-sensitivity,_ast_tool_unavailabletightening, cpp_lint cache Rust sources, lint-on-save examples, FL_LINT_AB retirement — 5 small fixes in one PR.Validation against the issue's own verification proxies
Exactly the 3 Tier-4 entries (out of scope per #3288).
Acceptance criteria status
test_wasm_clang_format.pyrule ports to Rust asEmAsmClangFormatChecker(ci/lint_cpp_rs/src/checkers/preprocessor.rs).test_missing_pragma_once.py,test_no_include_after_namespace.py,test_wrong_defines.py).PchFileCheckermatches case-sensitively on Linux (exact-case"pch"extension match)._ast_tool_unavailableno longer matches the bare"no such file or directory"substring (requires"clang-query"co-occurrence).FL_LINT_AB=1infrastructure deleted (RUST_SUPPORTED_CHECKERS,remove_rust_supported_checkers,run_rust_ab_check,_canonical_results,_print_diff_sample).cpp_lint_cache.pyfingerprint includesci/lint_cpp_rs/Cargo.{toml,lock}andsrc/**/*.rs.lint-on-save.pyno longer skipsexamples/C++ files.ci/fix_has_include.pykeeps its manual-tool docstring marking it as a one-shot utility with the CI-rule note.Final state
EmAsmClangFormatCheckerin refactor(lint): port EM_ASM clang-format pytest to Rust; drop 3 duplicate pytests (#3308) #3321).bash lint --cppis green on master.PR #3320's macOS CI failure was the soldr/zccache aarch64-apple-darwin rate-limit cascade (not from this PR's code) — merged via API after the linux/windows/wasm/example-tests checks all passed. The macOS rate-limit issue is environmental and orthogonal to #3308's acceptance criteria.