You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
lint: inspect code adjacent to block comments in bare legacy checkers #3946
The five legacy single-line Rust lint checkers in ci/lint_cpp_rs/src/checkers/bare_legacy.rs share python_style_pass_through_line(). Its block-comment state machine skips the entire line whenever a multiline block comment opens or closes, and it does not strip same-line /* ... */ comments.
This preserves a false-negative/false-positive bug from the retired Python checker that CodeRabbit identified on PR #2830: #2830 (comment)
The bug is still present on current master after the Rust migration in #3297:
banned_call(); /* comment starts is skipped, so real code before /* is not checked.
*/ banned_call(); is skipped, so real code after */ is not checked.
/* banned_call(); */ is scanned as code, so a token inside a one-line block comment can be reported.
The shared helper affects BareNoInlineChecker, BareSnprintfChecker, BareLibmChecker, FlNoUnderscoreChecker, and LegacyLogMacroChecker.
Smallest fix
Use the existing strip_block_comments_from_line() helper before each affected checker inspects code, preserving visible code on both sides of block-comment spans. Apply line-comment splitting and per-rule suppression checks to the stripped visible text. Remove python_style_pass_through_line() once no checker depends on it.
RED -> GREEN acceptance criteria
Add focused Rust tests that fail before the fix for banned code before a multiline /*, banned code after a multiline */, and a banned token wholly inside a same-line /* ... */ comment.
Cover at least BareNoInlineChecker plus a second checker using the shared path, so the regression cannot be fixed for only one rule.
After the fix, visible code before/after block comments is reported, while tokens inside block comments are ignored.
Existing suppression comments continue to work.
bash lint --cpp passes.
Scope
Lint-only; no compiled FastLED behavior changes. This is a substantive unresolved review follow-up discovered while triaging #2981 and its related #2830 dispatch-size work.
Activity
fix(lint): preserve code around block comments (FastLED#3950)