Skip to content

feat(lint): retire Python C++ checkers; Rust fastled-lint is default (#3288) - #3293

Merged
zackees merged 7 commits into
masterfrom
feat/3288-rust-cpp-linter-default
Jun 19, 2026
Merged

zackees merged 7 commits into
masterfrom
feat/3288-rust-cpp-linter-default

Conversation

@zackees

@zackees zackees commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #3288 and #3297. Migrates the C++ lint pipeline to the Rust
fastled-lint binary (ci/lint_cpp_rs/) as the mandatory default
everywhere — bash lint --cpp, hooks, and CI. Retires 70 Python
checkers in total.

Headline numbers

Verification command (acceptance criterion from #3297)

ls ci/lint_cpp/*.py ci/tools/check_noexcept.py ci/tools/check_array_params.py 2>/dev/null \
  | grep -vE "/(rust_binary_cache|rust_bridge|run_all_checkers|test_noexcept_checker)\.py$"

Output as of this PR's HEAD:

ci/lint_cpp/noexcept_checker.py
ci/tools/check_array_params.py
ci/tools/check_noexcept.py

3 lines (Tier-4 only) ⇒ migration complete within stated bounds.

What's in here

  • Build-on-change cache at ci/lint_cpp/rust_binary_cache.py
    fingerprints ci/lint_cpp_rs/src/**/*.rs + Cargo.toml + Cargo.lock
    natively via os.stat + blake2b — ~1ms hot path, no broker IPC.
    Rebuilds via soldr only when sources change. Host-aware /
    deterministic binary-path selection. Atomic fingerprint write
    (tmp + os.replace).
  • --rust is default-on via argparse.BooleanOptionalAction;
    --no-rust is the escape hatch.
  • .github/workflows/template_unit_test.yml runs bash lint --cpp
    on every PR, with actions/cache@v4 for ci/lint_cpp_rs/target/
    keyed on Cargo.lock + src/**/*.rs, plus a timeout-minutes: 30
    job cap.
  • soldr>=0.7.55 pinned in pyproject.toml.
  • 70 Rust-ported Python *_checker.py files deleted plus their tests.
    Surgical edits where files held shared data tables.
  • run_all_checkers.py now instantiates ZERO Python-only checkers.
    Cross-file structural walks (pch_file, test_aggregation, unity_build,
    iwyu_pragma_check) ship as the Rust run_structural_passes() hook
    invoked after the per-file pass.

Grand-dispatch preservation

The Rust MultiCheckerFileProcessor
(ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs) uses a
per-path HashMap cache, reads files in parallel via rayon, then runs
every interested checker on each cached FileContent — read-once +
N-checkers preserved (and parallelized) from Python.

A/B parity verified

FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py passes
for all 70 entries in RUST_SUPPORTED_CHECKERS (zero divergence).

Test plan

🤖 Generated with Claude Code

…loses #3288)

Migrates the C++ lint pipeline to the Rust `fastled-lint` binary as the
mandatory default everywhere - `bash lint --cpp`, hooks, and CI. Retires
the 60 Python checkers that have parity-verified Rust ports.

Key changes:
- New ci/lint_cpp/rust_binary_cache.py: native-Python file-mtime fingerprint
  over Rust sources. Rebuilds the binary only when missing or sources change;
  otherwise returns the cached path with sub-ms overhead. Removes the
  per-invocation soldr fingerprint-scan tax (~300-800ms on Windows). Handles
  both target/release/ and target/<triple>/release/ layouts.
- ci/lint_cpp/rust_bridge.py: invokes the cached binary directly instead of
  rebuilding on every lint call.
- pyproject.toml: pins soldr>=0.7.55 for the rare rebuild path.
- ci/lint/args_parser.py + ci/lint_cpp/run_all_checkers.py: --rust now
  defaults to True via BooleanOptionalAction; --no-rust is the escape hatch.
- .github/workflows/template_unit_test.yml: adds a bash lint --cpp step
  exercising the Rust path on every PR.
- Deletes 58 Rust-ported Python checker files plus 12 in-package and
  external test files. Surgically edits banned_headers_checker.py (keeps
  the BANNED_HEADERS_* data tables) and test_aggregation_checker.py (keeps
  the cross-file structural pass).
- run_all_checkers.py now instantiates only the 6 Python-only checkers
  without Rust ports plus the cross-file structural checks and AST
  ratchets (noexcept, decayed array params).

Grand-dispatch preservation verified: the Rust MultiCheckerFileProcessor
uses a per-path HashMap cache, reads files in parallel via rayon, then
iterates files running every interested checker - the read-once + N-checkers
contract is preserved (and parallelized) from the Python implementation.

A/B parity verified: FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py
passes against all 60 RUST_SUPPORTED_CHECKERS.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR migrates C++ linting to a Rust-backed binary as the mandatory default. A new rust_binary_cache.py module rebuilds fastled-lint only when sources change, eliminating per-invocation build overhead. rust_bridge.py now invokes the cached binary directly. CLI defaults flip to --rust/True across all tools, the CI workflow runs bash lint --cpp with artifact caching, soldr is added as a guaranteed dependency, Python checker modules and tests are deleted, five new Rust checkers are implemented and registered, and comprehensive documentation updates guide developers toward the Rust-first architecture.

Changes

Rust C++ Linter as Mandatory Default with Build-on-Change Cache

Layer / File(s) Summary
Rust binary build-on-change cache
ci/lint_cpp/rust_binary_cache.py
New module: discovers fastled-lint binary across Cargo target triples, computes blake2b fingerprint over Rust sources (ci/lint_cpp_rs/src/**/*.rs, Cargo.toml, Cargo.lock), persists/loads fingerprint from .cache/rust_lint_binary.fingerprint, invokes soldr cargo build --release only on binary missing or source change, and exposes ensure_rust_lint_binary(verbose) function and CLI entry point.
Rust bridge switched to cached binary
ci/lint_cpp/rust_bridge.py
Imports ensure_rust_lint_binary and replaces prior soldr cargo run-based command with direct execution of resolved cached binary path; expands RUST_SUPPORTED_CHECKERS to include bare/legacy/public_settings checkers.
Flip Rust default in CLI arguments
ci/lint/args_parser.py, ci/lint.py, ci/lint_cpp/run_all_checkers.py
Flips LintArgs.use_rust_cpp_lint default to True; rewrites --rust argument to BooleanOptionalAction with default=True in args_parser.py and run_all_checkers.py; updates print_ai_hints() and epilog to document --no-rust fallback.
Add soldr dependency and wire Rust caching into CI
pyproject.toml, .github/workflows/template_unit_test.yml
Adds soldr>=0.7.55 to dependencies; adds timeout-minutes: 30 to build job; replaces old Python lint step with cached Rust build step (keyed on Cargo.lock + Rust sources) and bash lint --cpp invocation.
Reduce Python checker fleet and header collection
ci/lint_cpp/run_all_checkers.py
Prunes Python checker imports to surviving subset; rewrites create_checkers() to set most scopes empty; deletes _collect_all_headers() helper; removes all-headers computation from both single-file and normal-mode paths; replaces Python .pch checker with note that it's now a Rust structural pass.
Delete Python checker modules and tests
ci/lint_cpp/impl_hpp_includes_checker.py, ci/lint_cpp/reinterpret_cast_checker.py, ci/lint_cpp/test_aggregation_checker.py
Removes representative Python checker implementations; deletes TestAggregationChecker wrapper while retaining standalone helpers; drops unused imports.
Update lint orchestration and dependencies
ci/debug_attached.py, ci/dependencies.json
Replaces multi-command lint flow with single delegated ci/lint.py --cpp call; updates cpp_lint tool fleet to Rust+Python architecture and lint_command to bash lint --cpp with Rust default and --no-rust fallback.
Add Rust implementations of ported checkers
ci/lint_cpp_rs/src/checkers/bare_legacy.rs, ci/lint_cpp_rs/src/checkers/public_settings.rs, ci/lint_cpp_rs/src/checkers/structural_passes.rs
Introduces five FileContentChecker implementations (BareNoInlineChecker, BareSnprintfChecker, BareLibmChecker, FlNoUnderscoreChecker, LegacyLogMacroChecker) scanning for bare/legacy API usage with comment/suppression skipping and per-file exemptions. Adds PublicSettingsPatternChecker that scans for unwrapped public setters and checks wrapper presence in cached FastLED.h. Adds run_structural_passes() that performs once-per-lint .pch artifact scan.
Register new Rust checkers and wire regex patterns
ci/lint_cpp_rs/src/lib.rs, ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs, ci/lint_cpp_rs/src/lint_core/regexes.rs
Compiles new checker modules into crate; updates supported_checker_names() and supported_python_checker_names() for seven new checkers; wires create_checkers() to instantiate new per-file and structural checkers; updates run_cli to filter and execute structural passes in whole-project mode only; adds regex factory functions for noinline/printf/libm/FL_NO patterns and legacy logging macros.
Update development documentation and guidance
agents/docs/linter-architecture.md, .claude/agents/cpp-linter-builder-agent.md, .claude/skills/new-cpp-lint/SKILL.md, ci/lint_cpp_rs/src/checkers/README.md, ci/fix_has_include_README.md, agents/docs/cpp-standards.md, src/fl/stl/compiler_control.h, ci/lint_cpp_rs/src/checkers/platform_trampoline.rs
Rewrites architecture docs to describe two-tier system (Rust default + Python holdover); updates agent/skill guides to route new rules to Rust crate with four-part deliverable, Rust templates, and registration steps; updates referenced checker locations and removes obsolete Python-checker guidance; adds explanatory comments for scope dispatch and reference updates.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as bash lint --cpp
    participant ArgParser as args_parser.py
    participant RunAll as run_all_checkers.py
    participant Bridge as rust_bridge.py
    participant Cache as rust_binary_cache
    participant Binary as fastled-lint binary
    participant Rust as Rust checkers
    participant Python as Python checkers

    CLI->>ArgParser: parse args (use_rust_cpp_lint=True default)
    ArgParser-->>RunAll: LintArgs(use_rust_cpp_lint=True)
    RunAll->>Bridge: run_rust_linter(project_root, ...)
    Bridge->>Cache: ensure_rust_lint_binary()
    Cache->>Cache: enumerate inputs, compute fingerprint
    alt binary exists AND fingerprint matches
        Cache-->>Bridge: return cached binary path (zero overhead)
    else binary missing OR fingerprint mismatch
        Cache->>Cache: invoke soldr cargo build --release
        Cache->>Cache: persist new fingerprint
        Cache-->>Bridge: return rebuilt binary path
    end
    Bridge->>Binary: subprocess [binary_path, --json, --project-root, ...]
    Binary->>Rust: dispatch to per-file checkers
    Rust-->>Binary: per-file violations
    Binary->>Binary: run structural passes (once per lint)
    Binary-->>Bridge: JSON violations output
    Bridge-->>RunAll: convert to CheckerResults
    RunAll->>Python: run surviving Python checkers
    Python-->>RunAll: Python violations
    RunAll-->>CLI: merge + exit with lint report
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2689: Adds foundational Rust-backed C++ lint routing and bridge; this PR extends it with a build-on-change cache and makes Rust the mandatory default.
  • FastLED/FastLED#2715: Introduces the PublicSettingsPatternChecker rule which this PR ports to Rust and integrates into the default-enabled pipeline.
  • FastLED/FastLED#3121: Refactors Rust checker module organization in lint_cpp_rs/src/checkers/; this PR adds three new modules (bare_legacy.rs, public_settings.rs, structural_passes.rs) following that structure.

Poem

🐇 Hoppity hop, the Python checkers sleep deep,
A Rust binary wakes from its cache to reap.
--no-rust remains if you dare look back,
But fastled-lint now runs on the default track!
The bunny compiles once, then zips along fast —
A fingerprint guards every build to the last. 🦀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: retiring Python C++ checkers and making Rust fastled-lint the default. It is specific, avoids vague terms, and accurately reflects the PR's primary objective.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from issue #3288: introduces build-on-change cache, defaults --rust to True, removes 58+ Python checkers, updates workflows, and ports remaining checkers to Rust with parity verification.
Out of Scope Changes check ✅ Passed All changes are within scope of #3288: build cache, Rust binary wrapper, Python checker retirement, documentation updates, and infrastructure wiring. No unrelated refactoring or feature additions detected.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/3288-rust-cpp-linter-default

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
ci/lint_cpp/run_all_checkers.py (1)

745-750: ⚡ Quick win

Drop the now-unused all-header collection from main().

create_checkers() explicitly no longer consumes all_headers, but main() still computes it in both execution paths, adding unnecessary repo-wide traversal cost.

Suggested cleanup
-        files_by_dir = collect_all_files_by_directory()
-        all_headers = _collect_all_headers(files_by_dir)
-
-        # Create all checker instances
-        checkers_by_scope = create_checkers(all_headers=all_headers)
+        files_by_dir = collect_all_files_by_directory()
+        checkers_by_scope = create_checkers()
@@
-        # Extract all headers for cross-file validation
-        all_headers = _collect_all_headers(files_by_dir)
-
-        # Create all checker instances
-        checkers_by_scope = create_checkers(all_headers=all_headers)
+        # Create all checker instances
+        checkers_by_scope = create_checkers()

Also applies to: 804-809

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/lint_cpp/run_all_checkers.py` around lines 745 - 750, The `all_headers`
variable is being collected via `_collect_all_headers(files_by_dir)` but is no
longer used by the `create_checkers()` function. Remove the line that assigns
`all_headers = _collect_all_headers(files_by_dir)` and remove the
`all_headers=all_headers` parameter from the `create_checkers()` call in the
main function. Apply this cleanup to both execution paths in main() where this
pattern occurs (around lines 745-750 and 804-809).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ci/lint_cpp/rust_binary_cache.py`:
- Around line 56-62: The binary selection in the target_root iteration is
non-deterministic and doesn't account for host-target compatibility. To fix
this, sort the triple directories from target_root.iterdir() to ensure
deterministic ordering, then identify and prioritize the triple that matches the
current host architecture (using platform information like system and machine)
before iterating through candidates. Apply the same logic to any similar code in
the 65-71 range that also selects binaries based on target triples.

---

Nitpick comments:
In `@ci/lint_cpp/run_all_checkers.py`:
- Around line 745-750: The `all_headers` variable is being collected via
`_collect_all_headers(files_by_dir)` but is no longer used by the
`create_checkers()` function. Remove the line that assigns `all_headers =
_collect_all_headers(files_by_dir)` and remove the `all_headers=all_headers`
parameter from the `create_checkers()` call in the main function. Apply this
cleanup to both execution paths in main() where this pattern occurs (around
lines 745-750 and 804-809).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 64a5d08a-869f-48de-9a3a-a8eb13cbb8a1

📥 Commits

Reviewing files that changed from the base of the PR and between cb82d68 and 26329e1.

📒 Files selected for processing (80)
  • .github/workflows/template_unit_test.yml
  • ci/lint.py
  • ci/lint/args_parser.py
  • ci/lint_cpp/arduino_macro_usage_checker.py
  • ci/lint_cpp/asm_js_location_checker.py
  • ci/lint_cpp/attribute_checker.py
  • ci/lint_cpp/banned_define_checker.py
  • ci/lint_cpp/banned_headers_checker.py
  • ci/lint_cpp/banned_macros_checker.py
  • ci/lint_cpp/banned_namespace_checker.py
  • ci/lint_cpp/bare_allocation_checker.py
  • ci/lint_cpp/bare_using_checker.py
  • ci/lint_cpp/builtin_memcpy_checker.py
  • ci/lint_cpp/check_namespace_includes.py
  • ci/lint_cpp/check_platform_includes.py
  • ci/lint_cpp/check_platforms_fl_namespace.py
  • ci/lint_cpp/check_using_namespace.py
  • ci/lint_cpp/cpp_hpp_header_pair_checker.py
  • ci/lint_cpp/cpp_hpp_includes_checker.py
  • ci/lint_cpp/cpp_include_checker.py
  • ci/lint_cpp/ctype_global_checker.py
  • ci/lint_cpp/enum_class_checker.py
  • ci/lint_cpp/esp_rom_printf_checker.py
  • ci/lint_cpp/example_serial_checker.py
  • ci/lint_cpp/fastled_header_usage_checker.py
  • ci/lint_cpp/fl_is_defined_checker.py
  • ci/lint_cpp/headers_exist_checker.py
  • ci/lint_cpp/impl_hpp_includes_checker.py
  • ci/lint_cpp/include_after_namespace_checker.py
  • ci/lint_cpp/include_paths_checker.py
  • ci/lint_cpp/is_header_include_checker.py
  • ci/lint_cpp/iwyu_pragma_block_checker.py
  • ci/lint_cpp/logging_in_iram_checker.py
  • ci/lint_cpp/member_style_checker.py
  • ci/lint_cpp/namespace_platforms_checker.py
  • ci/lint_cpp/native_platform_defines_checker.py
  • ci/lint_cpp/net_namespace_checker.py
  • ci/lint_cpp/no_namespace_fl_declaration.py
  • ci/lint_cpp/no_using_namespace_fl_in_headers.py
  • ci/lint_cpp/noexcept_special_members_checker.py
  • ci/lint_cpp/numeric_limit_macros_checker.py
  • ci/lint_cpp/platform_includes_checker.py
  • ci/lint_cpp/platform_pragma_checker.py
  • ci/lint_cpp/pragma_once_checker.py
  • ci/lint_cpp/raw_noexcept_checker.py
  • ci/lint_cpp/raw_pragma_checker.py
  • ci/lint_cpp/reinterpret_cast_checker.py
  • ci/lint_cpp/relative_include_checker.py
  • ci/lint_cpp/run_all_checkers.py
  • ci/lint_cpp/rust_binary_cache.py
  • ci/lint_cpp/rust_bridge.py
  • ci/lint_cpp/serial_printf_checker.py
  • ci/lint_cpp/simd_intrinsics_checker.py
  • ci/lint_cpp/singleton_in_headers_checker.py
  • ci/lint_cpp/sleep_for_checker.py
  • ci/lint_cpp/span_from_pointer_checker.py
  • ci/lint_cpp/static_in_headers_checker.py
  • ci/lint_cpp/std_namespace_checker.py
  • ci/lint_cpp/stdint_type_checker.py
  • ci/lint_cpp/subdir_namespace_checker.py
  • ci/lint_cpp/test_aggregation_checker.py
  • ci/lint_cpp/test_asm_js_location_checker.py
  • ci/lint_cpp/test_banned_macros_checker.py
  • ci/lint_cpp/test_include_paths_checker.py
  • ci/lint_cpp/test_is_header_include_checker.py
  • ci/lint_cpp/test_native_platform_defines_checker.py
  • ci/lint_cpp/test_noexcept_special_members_checker.py
  • ci/lint_cpp/test_optimized_checkers.py
  • ci/lint_cpp/test_path_structure_checker.py
  • ci/lint_cpp/test_raw_noexcept_checker.py
  • ci/lint_cpp/test_rust_parity.py
  • ci/lint_cpp/test_singleton_in_headers_checker.py
  • ci/lint_cpp/thread_local_keyword_checker.py
  • ci/lint_cpp/unit_test_checker.py
  • ci/lint_cpp/using_namespace_fl_in_examples_checker.py
  • ci/lint_cpp/weak_attribute_checker.py
  • ci/tests/test_bare_using_in_headers.py
  • ci/tests/test_example_serial_checker.py
  • ci/tests/test_platform_includes_checker.py
  • pyproject.toml
💤 Files with no reviewable changes (71)
  • ci/lint_cpp/test_path_structure_checker.py
  • ci/lint_cpp/cpp_hpp_header_pair_checker.py
  • ci/lint_cpp/example_serial_checker.py
  • ci/lint_cpp/builtin_memcpy_checker.py
  • ci/lint_cpp/std_namespace_checker.py
  • ci/lint_cpp/banned_namespace_checker.py
  • ci/lint_cpp/static_in_headers_checker.py
  • ci/lint_cpp/net_namespace_checker.py
  • ci/lint_cpp/headers_exist_checker.py
  • ci/lint_cpp/relative_include_checker.py
  • ci/lint_cpp/thread_local_keyword_checker.py
  • ci/lint_cpp/test_include_paths_checker.py
  • ci/lint_cpp/pragma_once_checker.py
  • ci/lint_cpp/weak_attribute_checker.py
  • ci/lint_cpp/check_namespace_includes.py
  • ci/lint_cpp/esp_rom_printf_checker.py
  • ci/lint_cpp/subdir_namespace_checker.py
  • ci/lint_cpp/check_platforms_fl_namespace.py
  • ci/tests/test_example_serial_checker.py
  • ci/lint_cpp/reinterpret_cast_checker.py
  • ci/lint_cpp/no_namespace_fl_declaration.py
  • ci/lint_cpp/span_from_pointer_checker.py
  • ci/lint_cpp/sleep_for_checker.py
  • ci/tests/test_bare_using_in_headers.py
  • ci/lint_cpp/include_after_namespace_checker.py
  • ci/lint_cpp/banned_define_checker.py
  • ci/lint_cpp/banned_macros_checker.py
  • ci/lint_cpp/simd_intrinsics_checker.py
  • ci/lint_cpp/fl_is_defined_checker.py
  • ci/lint_cpp/logging_in_iram_checker.py
  • ci/lint_cpp/test_is_header_include_checker.py
  • ci/lint_cpp/fastled_header_usage_checker.py
  • ci/lint_cpp/test_banned_macros_checker.py
  • ci/lint_cpp/namespace_platforms_checker.py
  • ci/lint_cpp/raw_pragma_checker.py
  • ci/lint_cpp/check_using_namespace.py
  • ci/lint_cpp/test_rust_parity.py
  • ci/lint_cpp/member_style_checker.py
  • ci/lint_cpp/stdint_type_checker.py
  • ci/lint_cpp/include_paths_checker.py
  • ci/lint_cpp/impl_hpp_includes_checker.py
  • ci/lint_cpp/singleton_in_headers_checker.py
  • ci/lint_cpp/serial_printf_checker.py
  • ci/lint_cpp/test_raw_noexcept_checker.py
  • ci/lint_cpp/asm_js_location_checker.py
  • ci/lint_cpp/attribute_checker.py
  • ci/tests/test_platform_includes_checker.py
  • ci/lint_cpp/enum_class_checker.py
  • ci/lint_cpp/bare_using_checker.py
  • ci/lint_cpp/cpp_include_checker.py
  • ci/lint_cpp/platform_pragma_checker.py
  • ci/lint_cpp/bare_allocation_checker.py
  • ci/lint_cpp/unit_test_checker.py
  • ci/lint_cpp/no_using_namespace_fl_in_headers.py
  • ci/lint_cpp/check_platform_includes.py
  • ci/lint_cpp/raw_noexcept_checker.py
  • ci/lint_cpp/platform_includes_checker.py
  • ci/lint_cpp/using_namespace_fl_in_examples_checker.py
  • ci/lint_cpp/noexcept_special_members_checker.py
  • ci/lint_cpp/iwyu_pragma_block_checker.py
  • ci/lint_cpp/test_noexcept_special_members_checker.py
  • ci/lint_cpp/test_asm_js_location_checker.py
  • ci/lint_cpp/test_optimized_checkers.py
  • ci/lint_cpp/native_platform_defines_checker.py
  • ci/lint_cpp/ctype_global_checker.py
  • ci/lint_cpp/test_singleton_in_headers_checker.py
  • ci/lint_cpp/arduino_macro_usage_checker.py
  • ci/lint_cpp/cpp_hpp_includes_checker.py
  • ci/lint_cpp/test_native_platform_defines_checker.py
  • ci/lint_cpp/numeric_limit_macros_checker.py
  • ci/lint_cpp/is_header_include_checker.py

Comment thread ci/lint_cpp/rust_binary_cache.py Resolved
…3293

Follow-up to the Rust C++ linter migration. Addresses both CodeRabbit
findings on PR #3293 and finishes the Python-stub retirement that was
deferred for safety in the previous pass.

CodeRabbit fixes:
- rust_binary_cache._binary_candidate_paths: ordering is now
  deterministic and host-aware. Prefer CARGO_BUILD_TARGET, then the
  guessed host triple, then plain target/release/, then any remaining
  triple dir sorted by name. Dedupes via a seen-set so the host triple
  is never visited twice. Closes the "wrong-arch binary silently
  selected on multi-triple checkout" hazard CodeRabbit flagged.
- run_all_checkers.main: dropped the all_headers collection in both
  the single-file and full-tree branches plus the orphan
  _collect_all_headers helper. create_checkers() stopped consuming
  that frozenset when the legacy IwyuPragmaBlockChecker (the sole
  consumer) was retired to Rust.

Dead Python stubs deleted:
- banned_headers_checker.py: kept as a data-only shell in the previous
  pass, but its BANNED_HEADERS_* / HeaderException / EXCEPTION_RULES
  tables have zero remaining Python importers. The Rust crate has its
  own complete copy in ci/lint_cpp_rs/src/lint_core/banned_header_data.rs.
- has_include_checker.py: orphan file with no callers anywhere in the
  tree.
- test_file_wrapper_checker.py: orphan FL_TEST_FILE wrapper checker
  with no callers (the live FL_TEST_FILE enforcement runs through
  test_unity_build / test_aggregation paths).

Verification:
- bash lint --cpp -> all phases green
- uv run python ci/lint_cpp/run_all_checkers.py -> pass
- FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py ->
  Rust/Python parity holds
- rust_binary_cache.py prints the host triple binary path first

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees and others added 2 commits June 19, 2026 14:57
Follow-up to the 5-agent audit pass. Three classes of fix:

1. rust_binary_cache.py:
   - Atomic fingerprint write via tmp + os.replace. Closes the Windows
     torn-read window where a concurrent Stop hook + manual bash lint
     could read a half-written fingerprint and trigger a redundant
     rebuild.
   - Dropped phantom rust-toolchain.toml from _FINGERPRINT_INPUTS — the
     file does not exist in the crate. The docstring previously claimed
     it was a tracked input; now matches reality.

2. .github/workflows/template_unit_test.yml:
   - Added actions/cache@v4 for ci/lint_cpp_rs/target/ + the binary
     fingerprint, keyed on Cargo.lock + every src/**/*.rs + Cargo.toml.
     Skips the soldr cargo build (~60-180s) on every CI run when the
     crate sources haven't changed. With restore-keys fallback the
     partial cache also seeds future builds.
   - timeout-minutes: 30 on the unit-test job. Previously inherited
     the GitHub default of 360, so a wedged soldr daemon could burn a
     runner-hour silently.

3. ci/lint_cpp_rs/src/checkers/platform_trampoline.rs:
   - Clarified the IwyuPragmaBlockChecker should_process_file comment.
     The audit flagged a scope mismatch vs the Python checker's class
     declaration, but that read was misleading — Python's
     should_process_file was permissive while the dispatch layer
     (checkers_by_scope[\"fl\"] / [\"platforms\"]) pruned files
     outside fl/ + platforms/ before they ever reached the checker.
     Effective Python scope matches the existing Rust scope; A/B
     parity still passes. Comment now documents the dispatch-layer
     pruning so future readers don't repeat the audit mistake.

Verification:
- bash lint --cpp -> pass
- uv run python ci/lint_cpp/run_all_checkers.py -> pass
- FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py -> Rust/
  Python parity holds
- pyright clean

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Cleans up the long tail flagged by the audit on PR #3293. Three buckets:

1. Doc rewrites (the architecture references future contributors hit
   first):
   - agents/docs/linter-architecture.md: rewritten end-to-end to
     describe the two-tier (Rust default + small Python holdover)
     architecture, the four-step Rust workflow for adding a checker,
     and the "when to still use Python" cases (AST ratchets +
     cross-file structural passes + the 6 remaining single-file
     Python checkers).
   - .claude/agents/cpp-linter-builder-agent.md: replaced the Python
     FileContentChecker template with a Rust struct + impl, the
     unittest template with an inline #[cfg(test)] mod tests, and
     the registration table with the 3-site Rust + 1-site
     rust_bridge edit.
   - .claude/skills/new-cpp-lint/SKILL.md: retargeted phases so the
     scaffolded artifacts land under ci/lint_cpp_rs/src/checkers/.

2. Dead references in code/config/docs:
   - ci/debug_attached.py: replaced direct ci/lint_cpp/run_all_checkers.py
     invocation with `ci/lint.py --cpp` so the Rust path is used and
     future default flips are picked up automatically. Dropped the
     follow-on standalone `cpp_lint.py src/` step — RelativeIncludeChecker
     and FastLEDHeaderUsageChecker ship in the Rust crate now.
   - cpp_lint.py: deleted. Was the orphan root-level relative-includes
     + FastLED.h tool with zero callers after debug_attached.py stopped
     invoking it.
   - ci/dependencies.json: pruned the dead checker catalog (15 deleted
     .py filenames) and replaced with the current Rust + Python-only
     fleet.
   - ci/fix_has_include_README.md: dropped the section about the
     deleted ci/lint_cpp/has_include_checker.py CI linter; rewrote
     "Future Improvements" to point at adding a Rust checker;
     retargeted "Related Files" + "See Also" at live Rust paths.
   - ci/lint_cpp_rs/src/checkers/README.md: updated the lead-in to
     note Python checker retirement and that new checkers go in the
     Rust crate.
   - src/fl/stl/compiler_control.h: FL_ALLOW_PLATFORM_PRAGMA escape-
     hatch comment now names the Rust PlatformPragmaChecker (in
     ci/lint_cpp_rs/src/checkers/style.rs).
   - agents/docs/cpp-standards.md: static-in-header rule now cites
     the Rust StaticInHeaderChecker (ci/lint_cpp_rs/src/checkers/style.rs)
     instead of the deleted Python test file.

3. Verification:
   - bash lint --cpp -> green
   - uv run python ci/lint_cpp/run_all_checkers.py -> green
   - FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py ->
     Rust/Python parity holds
   - pyright clean on changed Python files
   - ci/dependencies.json parses as valid JSON
   - Final grep sweep finds no remaining references to any of the
     58 deleted Python checker files anywhere in the tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
agents/docs/linter-architecture.md (1)

1-12: 💤 Low value

Clarity: Document where the Python orchestrator entry point is now located.

Lines 1–12 mention bash lint --cpp calls the orchestrator and that "the Python orchestrator is still the entrypoint," but the specific invocation path (uv run python -m ci.lint_cpp.run_all_checkers) is only mentioned on line 16. Consider moving or emphasizing this in the introduction so readers understand the entry point immediately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agents/docs/linter-architecture.md` around lines 1 - 12, The introduction
section (lines 1-12) states that the Python orchestrator is the entrypoint for
`bash lint --cpp` but does not show the actual invocation command. Add or move
the specific Python invocation path (the `uv run python -m
ci.lint_cpp.run_all_checkers` command) into the introductory Two-Tier
Architecture section, ideally near the statement about the Python orchestrator
being the entrypoint, so readers immediately understand the concrete entry point
without having to read further into the document.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agents/docs/linter-architecture.md`:
- Around line 40-75: The documentation file linter-architecture.md should be
updated to clarify that helper functions like FileContent, ends_with_any,
is_under_dir, normalize_path, split_line_comment, and strip_string_literals are
private functions accessible only because lib.rs uses include!() to inline all
source files into a single compilation unit. Add an explanation stating that new
checker implementations must be added within the same monolithic crate structure
by creating files in the checkers/ directory and registering them in lib.rs,
rather than attempting to import these helpers from external modules. This
clarification should be added near the example implementation to prevent
misunderstandings about how checkers access internal helper functions.

---

Nitpick comments:
In `@agents/docs/linter-architecture.md`:
- Around line 1-12: The introduction section (lines 1-12) states that the Python
orchestrator is the entrypoint for `bash lint --cpp` but does not show the
actual invocation command. Add or move the specific Python invocation path (the
`uv run python -m ci.lint_cpp.run_all_checkers` command) into the introductory
Two-Tier Architecture section, ideally near the statement about the Python
orchestrator being the entrypoint, so readers immediately understand the
concrete entry point without having to read further into the document.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fbba150b-717e-46a5-b61a-f7ac8b4ba98b

📥 Commits

Reviewing files that changed from the base of the PR and between 5a6add1 and 33d20a2.

📒 Files selected for processing (10)
  • .claude/agents/cpp-linter-builder-agent.md
  • .claude/skills/new-cpp-lint/SKILL.md
  • agents/docs/cpp-standards.md
  • agents/docs/linter-architecture.md
  • ci/debug_attached.py
  • ci/dependencies.json
  • ci/fix_has_include_README.md
  • ci/lint_cpp_rs/src/checkers/README.md
  • cpp_lint.py
  • src/fl/stl/compiler_control.h
💤 Files with no reviewable changes (1)
  • cpp_lint.py
✅ Files skipped from review due to trivial changes (5)
  • src/fl/stl/compiler_control.h
  • ci/lint_cpp_rs/src/checkers/README.md
  • agents/docs/cpp-standards.md
  • .claude/agents/cpp-linter-builder-agent.md
  • ci/fix_has_include_README.md

Comment thread agents/docs/linter-architecture.md Resolved
Follow-up to #3288 / PR #3293. Drops 7 Python `.py` files from the cpp
lint pipeline by porting their checkers to the Rust `fastled-lint`
binary. The build-on-change cache and A/B parity guard from the
parent PR carry the verification.

Tier 1 — pure-regex single-file ports (5):
  - BareLibmChecker        (was ci/lint_cpp/bare_libm_checker.py)
  - BareNoInlineChecker    (was ci/lint_cpp/bare_noinline_checker.py)
  - BareSnprintfChecker    (was ci/lint_cpp/bare_snprintf_checker.py)
  - FlNoUnderscoreChecker  (was ci/lint_cpp/fl_no_underscore_checker.py)
  - LegacyLogMacroChecker  (was ci/lint_cpp/legacy_log_macro_checker.py)
All five land in new ci/lint_cpp_rs/src/checkers/bare_legacy.rs sharing
a `python_style_pass_through_line` helper that matches the Python
block-comment + `//` line + `// ok <suppress>` semantics exactly.
Regex patterns preserve the Python lookbehinds via a small post-match
`*_has_qualifier_prefix` predicate (Rust regex crate has no
lookbehind).

Tier 2 — cross-file load (1):
  - PublicSettingsPatternChecker (was
    ci/lint_cpp/public_settings_pattern_checker.py).
Lands in ci/lint_cpp_rs/src/checkers/public_settings.rs. Reads
`src/FastLED.h` once through a static `OnceLock<String>` keyed off the
project root, then reuses the cached content for every header scanned
in src/fl/. Preserves the GRANDFATHERED_NAMES + FUNCTION_POINTER_SETTERS
allowlists, the per-object setter heuristic (first-param-is-non-const-
ptr/ref-to-user-defined-type), and the suggestion message verbatim.

Tier 3 — structural pass (1):
  - PchFileChecker (was ci/lint_cpp/pch_file_checker.py).
The per-file dispatcher walks only .cpp/.h/.hpp/.ino/.cpp.hpp, so
.pch detection needs its own walk. Adds a new
ci/lint_cpp_rs/src/checkers/structural_passes.rs hosting
`run_structural_passes()`, invoked from `run_cli` after the per-file
pass when no explicit input paths are supplied. The hook is the
template that the remaining Tier-3 walkers (iwyu_pragma_check,
test_aggregation_checker, test_unity_build) will fill out in
follow-up PRs — they are documented as deferred on issue #3297.

Verification:
- FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py ->
  Rust/Python parity holds for all 67 ported checkers
  (60 from #3293 + 6 single-file + 1 structural = 67 in
  RUST_SUPPORTED_CHECKERS now).
- bash lint --cpp -> green.
- uv run python ci/lint_cpp/rust_binary_cache.py -> rebuilds the
  binary once after these crate edits, then no-ops.
- Verification command from #3297 trims from 11 to 6 unfinished
  Python files (target is the 3 Tier-4 AST ratchet entries; the
  3 remaining Tier-3 walkers are tracked on the same issue).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
ci/lint_cpp_rs/src/checkers/public_settings.rs (1)

39-46: 💤 Low value

Silent fallback when FastLED.h is missing may cause noisy false positives.

If src/FastLED.h doesn't exist or is unreadable, unwrap_or_default() returns an empty string. This causes is_wrapped_in_fastled_h to return false for every setter, flagging all of them as missing wrappers—potentially dozens of spurious violations.

Consider logging a warning or returning early from the checker when the file is missing, to distinguish "wrapper file missing" from "wrapper not found in file."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/lint_cpp_rs/src/checkers/public_settings.rs` around lines 39 - 46, The
fastled_h_content_for function silently falls back to an empty string when
src/FastLED.h is missing or unreadable, causing all setters to be incorrectly
flagged as missing wrappers. Instead of using unwrap_or_default(), handle the
error case explicitly by logging a warning message when the file cannot be read,
so that missing wrapper violations can be distinguished from a missing wrapper
file. This will prevent spurious false positive violations from being reported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ci/lint_cpp_rs/src/checkers/public_settings.rs`:
- Around line 39-46: The fastled_h_content_for function silently falls back to
an empty string when src/FastLED.h is missing or unreadable, causing all setters
to be incorrectly flagged as missing wrappers. Instead of using
unwrap_or_default(), handle the error case explicitly by logging a warning
message when the file cannot be read, so that missing wrapper violations can be
distinguished from a missing wrapper file. This will prevent spurious false
positive violations from being reported.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f2887a45-17dc-417d-96d3-2fa358b8546f

📥 Commits

Reviewing files that changed from the base of the PR and between 33d20a2 and ec54927.

📒 Files selected for processing (16)
  • ci/lint_cpp/bare_libm_checker.py
  • ci/lint_cpp/bare_noinline_checker.py
  • ci/lint_cpp/bare_snprintf_checker.py
  • ci/lint_cpp/fl_no_underscore_checker.py
  • ci/lint_cpp/legacy_log_macro_checker.py
  • ci/lint_cpp/pch_file_checker.py
  • ci/lint_cpp/public_settings_pattern_checker.py
  • ci/lint_cpp/run_all_checkers.py
  • ci/lint_cpp/rust_bridge.py
  • ci/lint_cpp/test_public_settings_pattern_checker.py
  • ci/lint_cpp_rs/src/checkers/bare_legacy.rs
  • ci/lint_cpp_rs/src/checkers/public_settings.rs
  • ci/lint_cpp_rs/src/checkers/structural_passes.rs
  • ci/lint_cpp_rs/src/lib.rs
  • ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs
  • ci/lint_cpp_rs/src/lint_core/regexes.rs
💤 Files with no reviewable changes (8)
  • ci/lint_cpp/pch_file_checker.py
  • ci/lint_cpp/fl_no_underscore_checker.py
  • ci/lint_cpp/bare_snprintf_checker.py
  • ci/lint_cpp/legacy_log_macro_checker.py
  • ci/lint_cpp/public_settings_pattern_checker.py
  • ci/lint_cpp/test_public_settings_pattern_checker.py
  • ci/lint_cpp/bare_libm_checker.py
  • ci/lint_cpp/bare_noinline_checker.py

zackees and others added 2 commits June 19, 2026 16:19
Closes #3297. Migrates the last three Python C++ linters into the Rust
fastled-lint binary, leaving only the explicitly-out-of-scope Tier-4
AST ratchet trio (#3288 carve-out).

Ports:
- IwyuPragmaPrivateChecker (ci/lint_cpp_rs/src/checkers/bare_legacy.rs):
  per-file check that headers under src/platforms/<subdir>/ carry an
  IWYU pragma marker. Root-level src/platforms/ files are public by
  default and remain exempt. Replaces ci/lint_cpp/iwyu_pragma_check.py
  and its subprocess shim in stage_impls.run_iwyu_pragma_check{,
  _single_file}().
- TestAggregationChecker structural pass
  (ci/lint_cpp_rs/src/checkers/structural_passes.rs): whole-project
  walker over TEST_AGGREGATED_DIRS that emits "Missing aggregator",
  "orphaned test file", and "should use .hpp" violations in the
  Python message format. Per-file TestAggregationChecker (already
  ported in #3293) keeps targeting individual aggregator / hpp files.
- UnityBuildChecker (ci/lint_cpp_rs/src/checkers/unity_build.rs):
  the largest port — 1204 LOC Python distilled into both
  - whole-project unity_build_pass() with 11 individual checks
    (legacy _build.hpp naming, hierarchy, .cpp.hpp completeness,
    section comments + ordering, subdir completeness, alphabetical
    order, no cross-dir includes, no invalid include types, build-
    file pre-headers, flat vs recursive build-file content, build-
    file naming, no orphan .cpp files, library.json srcFilter)
  - per-file UnityBuildChecker for single-file lint-on-save mode.

Wiring:
- structural_passes.rs run_structural_passes() now invokes the three
  cross-file walkers (pch_file, test_aggregation, unity_build) after
  the per-file dispatch when no explicit input paths are supplied.
- rust_bridge.py RUST_SUPPORTED_CHECKERS gains IwyuPragmaPrivateChecker,
  UnityBuildChecker; the orchestrator's remove_rust_supported_checkers
  pass and the A/B compare key on these names.
- run_all_checkers.py drops the run_unity_build_check(),
  check_unity_build_single_file(), and check_test_aggregation_single_file()
  call sites — they're now redundant with the Rust path.
- stage_impls.run_iwyu_pragma_check{,_single_file}() become no-op
  stubs (kept so existing callers don't break during the deprecation
  window).

Deletions:
- ci/lint_cpp/iwyu_pragma_check.py
- ci/lint_cpp/test_aggregation_checker.py
- ci/lint_cpp/test_unity_build.py

Verification:
- FL_LINT_AB=1 uv run python ci/lint_cpp/run_all_checkers.py ->
  Rust/Python parity holds for all 70 ported checkers
  (67 from prior commits + IwyuPragmaPrivateChecker + UnityBuildChecker
  + structural test_aggregation_pass).
- bash lint --cpp -> green.
- uv run python ci/lint_cpp/rust_binary_cache.py -> rebuilds the
  binary on first run, then no-ops.
- pyright clean on the changed Python files.
- Verification command output trimmed to exactly 3 lines (Tier-4 only):
    ci/lint_cpp/noexcept_checker.py
    ci/tools/check_array_params.py
    ci/tools/check_noexcept.py
  These remain by design — #3288 explicitly out-of-scopes the
  clang-query AST ratchets.

Migration #3297 is complete within its stated bounds.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…deRabbit

CI runs of `bash lint --cpp` on linux/macos failed because the
clang-query AST ratchets (FL_NO_EXCEPT + decayed array params) couldn't
locate `clang-tool-chain-query`: the CI runners don't have a full LLVM
toolchain installed and the `clang-tool-chain` Python wheel doesn't
ship the inner binary on those platforms. The ratchets are explicitly
out-of-scope per #3288 (Tier-4) and should not gate the lint when the
underlying tool is absent.

Changes:

1. ci/lint_cpp/run_all_checkers.py:
   - New `_ast_tool_unavailable()` helper that classifies the
     NoexceptCheckError / ArrayParamCheckError message as a
     tool-absence signal vs a real ratchet violation.
   - run_noexcept_ast_check + run_array_param_ast_check now print a
     stderr `⚠️ Skipping ...` warning when the AST tool is absent and
     return an empty CheckerResults, instead of emitting a fake
     violation that blocks the lint. Tool-absence is detected for both
     the "clang-query not found ... Install LLVM ..." flavor (raised
     when _find_clang_query returns empty) and the "Failed to spawn:
     `clang-tool-chain-query` ... No such file or directory" flavor
     (raised when uv can resolve uv itself but not the inner entry-
     point — exactly the case CI hit on linux/macos).

2. agents/docs/linter-architecture.md:
   - Addresses the CodeRabbit minor finding on this PR by adding a
     "Crate layout note" callout explaining that the lint_core helpers
     and the FileContentChecker trait are module-private and only
     reach checker files via `include!()` from lib.rs. Future
     contributors should add new files under
     ci/lint_cpp_rs/src/checkers/, wire them with another `include!()`
     in lib.rs, and avoid trying to `pub`-qualify or `use crate::...`
     these symbols.

Verification:
- bash lint --cpp -> green locally (clang-tool-chain-query IS on PATH
  on this dev box, so the AST ratchets run; the fallback only kicks in
  when the tool genuinely isn't available).
- uv run pyright ci/lint_cpp/run_all_checkers.py -> 0 errors.

The other CodeRabbit major finding on this PR
(`rust_binary_cache._binary_candidate_paths` host-aware ordering) was
addressed earlier in commit 7bd83d0 — CodeRabbit's
"✅ Addressed in commit 7bd83d0" note confirms.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit b4ac48a into master Jun 19, 2026
14 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 20, 2026
zackees added a commit that referenced this pull request Jun 20, 2026
…ool_unavailable tightening, cpp_lint cache Rust sources, lint-on-save examples, FL_LINT_AB retirement)

Five small lint-infrastructure fixes from issue #3308:

1. PchFileChecker case-sensitivity divergence (HIGH)
   ci/lint_cpp_rs/src/checkers/structural_passes.rs now uses an exact-case
   ext match (Some("pch")) instead of eq_ignore_ascii_case so the Rust port
   matches Python's case-sensitive rglob("*.pch") on Linux/macOS.

2. _ast_tool_unavailable over-broad (HIGH)
   ci/lint_cpp/run_all_checkers.py: dropped the bare "no such file or
   directory" branch; now requires the clang-query tool name to co-occur
   with "not found" or "failed to spawn".

3. cpp_lint_cache.py fingerprint omits Rust sources (MEDIUM)
   ci/cpp_lint_cache.py: added Cargo.toml, Cargo.lock and src/**/*.rs to
   both the default glob list and the DependencyManifest path so local
   edits to Rust checkers force a re-lint.

4. lint-on-save.py skips examples/ C++ files (MEDIUM)
   ci/hooks/lint-on-save.py: removed the examples/ short-circuit so the
   Rust path runs on save for examples-scope checkers
   (UsingNamespaceFlInExamplesChecker, ExampleSerialChecker, etc.); the
   fingerprint cache keeps per-save cost low.

5. FL_LINT_AB=1 is functionally a no-op (MEDIUM)
   create_checkers() returns all-empty lists post-#3293, so the A/B
   compare was trivially empty. Removed run_rust_ab_check,
   _canonical_results, _print_diff_sample, RUST_SUPPORTED_CHECKERS, and
   remove_rust_supported_checkers from ci/lint_cpp/rust_bridge.py and
   stripped the FL_LINT_AB env-var plumbing from
   ci/lint_cpp/run_all_checkers.py.

Drive-by: fixed a pre-existing pyright reportUnknownVariableType warning
on parse_rust_json_output() with an explicit cast.

Refs #3308

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 20, 2026
…3319)

* docs: retire stale references to deleted Python C++ checkers (#3308)

After #3293 migrated the C++ checker fleet from Python to the Rust
crate at ci/lint_cpp_rs/, several docs and configs still pointed at
deleted .py files. Update every stale pointer to the live Rust target
and prune the stale checker list in ci/dependencies.json.

- agents/docs/linter-architecture.md: rewrite "When to still use
  Python" — only the 3 Tier-4 AST ratchets remain in Python.
- agents/docs/cpp-standards.md: point Public Settings allowlist at
  ci/lint_cpp_rs/src/checkers/public_settings.rs::PUBLIC_SETTINGS_GRANDFATHERED.
- .claude/agents/cpp-linter-builder-agent.md: replace deleted unity /
  aggregation / pch py paths with the Rust analogues.
- .claude/agents/architecture-reviewer-agent.md: update PublicSettings
  pointer to the Rust checker.
- .claude/commands/code_review.md: same update.
- ci/dependencies.json: prune the tools array to surviving entries
  (run_all_checkers.py, rust_bridge.py, rust_binary_cache.py,
  noexcept_checker.py) plus the ci/lint_cpp_rs/ crate.
- src/fl/stl/compiler_control.h: redirect FL_NO_INLINE comment to
  BareNoInlineChecker in ci/lint_cpp_rs/src/checkers/bare_legacy.rs.
- ci/fix_has_include_README.md: rewrite the retired-rule paragraph
  per #3308 acceptance criterion.
- ci/fix_has_include.py: add docstring marking it manual-only.

Verified: bash lint --cpp passes; ci/dependencies.json parses; sweep
grep returns 0 hits outside ci/lint_cpp_rs/ migration comments.

Refs #3308.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* docs: address CodeRabbit — clarify AST ratchet count

The clang-query AST tier consists of two distinct ratchets (noexcept
and decayed array params) implemented across three Python files (the
orchestrator function file + two clang-query backends). Update the
sentence so the rule count matches CodeRabbit's reading while still
hinting at the file count the #3308 verification command surfaces.

Refs #3308.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jun 20, 2026
…tool_unavailable tightening, cpp_lint cache Rust sources, lint-on-save examples, FL_LINT_AB retirement (#3320)

Five small lint-infrastructure fixes from issue #3308:

1. PchFileChecker case-sensitivity divergence (HIGH)
   ci/lint_cpp_rs/src/checkers/structural_passes.rs now uses an exact-case
   ext match (Some("pch")) instead of eq_ignore_ascii_case so the Rust port
   matches Python's case-sensitive rglob("*.pch") on Linux/macOS.

2. _ast_tool_unavailable over-broad (HIGH)
   ci/lint_cpp/run_all_checkers.py: dropped the bare "no such file or
   directory" branch; now requires the clang-query tool name to co-occur
   with "not found" or "failed to spawn".

3. cpp_lint_cache.py fingerprint omits Rust sources (MEDIUM)
   ci/cpp_lint_cache.py: added Cargo.toml, Cargo.lock and src/**/*.rs to
   both the default glob list and the DependencyManifest path so local
   edits to Rust checkers force a re-lint.

4. lint-on-save.py skips examples/ C++ files (MEDIUM)
   ci/hooks/lint-on-save.py: removed the examples/ short-circuit so the
   Rust path runs on save for examples-scope checkers
   (UsingNamespaceFlInExamplesChecker, ExampleSerialChecker, etc.); the
   fingerprint cache keeps per-save cost low.

5. FL_LINT_AB=1 is functionally a no-op (MEDIUM)
   create_checkers() returns all-empty lists post-#3293, so the A/B
   compare was trivially empty. Removed run_rust_ab_check,
   _canonical_results, _print_diff_sample, RUST_SUPPORTED_CHECKERS, and
   remove_rust_supported_checkers from ci/lint_cpp/rust_bridge.py and
   stripped the FL_LINT_AB env-var plumbing from
   ci/lint_cpp/run_all_checkers.py.

Drive-by: fixed a pre-existing pyright reportUnknownVariableType warning
on parse_rust_json_output() with an explicit cast.

Refs #3308

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the feat/3288-rust-cpp-linter-default branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Mandatory C++ linter migration: Rust-only via build-on-change cache, retire Python checkers

1 participant