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: wire SingletonElisionChecker into bash lint (warn-only) #3482
Register the existing SingletonElisionChecker (currently defined in ci/lint_cpp_rs/src/checkers/singleton_elision.rs, included via ci/lint_cpp_rs/src/lib.rs) into the runtime registry so bash lint executes it.
Concrete steps
Add "singleton_elision" to the enabled-checkers list in ci/lint_cpp_rs/src/lint_core/processor_registry_cli.rs::create_checkers() (see line ~524 where SerialPrintfChecker is registered as the pattern).
Add the checker name to the enabled list around line ~295.
Emit at warn severity, not error — the migration will land incrementally, so the initial rollout must not fail CI.
Provide a --include=singleton_elision opt-in flag / env variable so authors touching known-clean areas can verify their file is clean without seeing the full warn spam.
Acceptance criteria
bash lint reports the ~119 existing violations as warnings (not errors), listing file + line + suggested fix (wrap in fl::Singleton<T> for --gc-sections elision).
CI stays green.
The scanner Python (ci/scan_singleton_elision.py) can be marked deprecated in favor of the Rust checker output.
Investigated this and the premise no longer holds — the wiring is already done, and it isn't what's blocking the acceptance criteria.
Steps 1 and 2 are already in place on master:
"singleton_elision" is in supported_checker_names() (processor_registry_cli.rs:297)
("singleton_elision", Box::new(SingletonElisionChecker)) is in create_checkers() (:527)
fastled-lint --list-checkers lists it
include!("checkers/singleton_elision.rs") is in lib.rs:20
(The PascalCase list around :365 is supported_python_checker_names() — for legacy Python checkers — so a Rust-only checker correctly does not belong there.)
The actual blocker: the checker reports zero violations.
$ fastled-lint --checker singleton_elision # whole tree
All Rust C++ linting checks passed!
Not a file-selection or allowlist artifact. I narrowed it down:
ci/scan_singleton_elision.py reports 101 violations across 39 files on the same tree, so the violations exist.
The worst offender (channel_manager_esp32.cpp.hpp, 14 per the scanner) yields nothing, and it does not carry the FL_LINT_ALLOW_GLOBAL_FILE opt-out — only 2 files in src/ do.
Not a stale binary: the compiled fastled-lint.exedoes contain the checker's message string (wrap in \fl::Singleton` for ...`), so the current logic is linked in.
Not a path/separator issue: is_under_project_subpath normalizes both sides, and explicit --project-root (relative and absolute) changes nothing.
So SingletonElisionChecker::check_file_content is reaching its violations.push site for no input — most likely a bug in the brace-depth / namespace-stack tracking that starts the scan in a state where every line is skipped.
Implication for this issue and #3492: "wire it in warn-only" is already satisfied mechanically, but the acceptance criterion ("bash lint reports the ~119 existing violations as warnings") cannot be met until the checker actually detects anything. #3492 (promote to hard-fail) is currently a no-op promotion — it would pass trivially and guard nothing, which is the more dangerous outcome.
Suggest retitling this to fix SingletonElisionChecker detection (currently a silent no-op), since that is the real remaining work. Item 4 of the original scope (the --include=singleton_elision opt-in) is also already covered by the existing --checker <name> flag.
I did not attempt the detection fix in this pass — it needs a proper Rust unit test alongside it so the checker can't silently regress to a no-op again, which is arguably the root cause here: a checker with no test asserting it finds something can be registered and look healthy while doing nothing.
Activity
zackees commentedon Jul 28, 2026
Investigated this and the premise no longer holds — the wiring is already done, and it isn't what's blocking the acceptance criteria.
Steps 1 and 2 are already in place on master:
"singleton_elision"is insupported_checker_names()(processor_registry_cli.rs:297)("singleton_elision", Box::new(SingletonElisionChecker))is increate_checkers()(:527)fastled-lint --list-checkerslists itinclude!("checkers/singleton_elision.rs")is inlib.rs:20(The PascalCase list around
:365issupported_python_checker_names()— for legacy Python checkers — so a Rust-only checker correctly does not belong there.)The actual blocker: the checker reports zero violations.
Not a file-selection or allowlist artifact. I narrowed it down:
ci/scan_singleton_elision.pyreports 101 violations across 39 files on the same tree, so the violations exist.channel_manager_esp32.cpp.hpp, 14 per the scanner) yields nothing, and it does not carry theFL_LINT_ALLOW_GLOBAL_FILEopt-out — only 2 files insrc/do.fastled-lint.exedoes contain the checker's message string (wrap in \fl::Singleton` for ...`), so the current logic is linked in.is_under_project_subpathnormalizes both sides, and explicit--project-root(relative and absolute) changes nothing.So
SingletonElisionChecker::check_file_contentis reaching itsviolations.pushsite for no input — most likely a bug in the brace-depth / namespace-stack tracking that starts the scan in a state where every line is skipped.Implication for this issue and #3492: "wire it in warn-only" is already satisfied mechanically, but the acceptance criterion ("
bash lintreports the ~119 existing violations as warnings") cannot be met until the checker actually detects anything. #3492 (promote to hard-fail) is currently a no-op promotion — it would pass trivially and guard nothing, which is the more dangerous outcome.Suggest retitling this to fix SingletonElisionChecker detection (currently a silent no-op), since that is the real remaining work. Item 4 of the original scope (the
--include=singleton_elisionopt-in) is also already covered by the existing--checker <name>flag.I did not attempt the detection fix in this pass — it needs a proper Rust unit test alongside it so the checker can't silently regress to a no-op again, which is arguably the root cause here: a checker with no test asserting it finds something can be registered and look healthy while doing nothing.
fix(lint): SingletonElisionChecker was a silent no-op; add warn-only …