Repository navigation
feat(lint): flag a new driver-enabling define; document the template rule (#4940) - #4955
Merged
Merged
Conversation
…rule (#4940) Umbrella for the ESP8266 define-elimination epic (#4949): state the rule and guard it. - agents/docs/cpp-standards.md: new REQUIRED section 'Driver selection is by template, never a code-enabling define' with the BusTraits/BusSupports shape and the retired offenders (FASTLED_ESP8266_UART, FASTLED_ALL_PINS_HARDWARE_SPI, FL_ESP8266_EMBEDDED_FS). - ci/lint_cpp/driver_enable_define_checker.py (new): a Python FileContentChecker that flags a preprocessor guard wrapping a 'platforms/...' include under src/platforms/** in an FL_*/FASTLED_* macro -- the code-enabling-define shape. The guards shipping today are grandfathered in driver_enable_define_amnesty.txt (regenerate with --generate-amnesty); new ones fail. Registered in run_all_checkers.py. - ci/tests/test_driver_enable_define_checker.py (new): flagged/allowed cases plus a tree-wide check that the amnesty still covers src/platforms. Wired into PY_SMOKE (guard in test_native_ci_modes.py bumped 9 -> 10). The three conversions land in #4951 / #4952 / #4953; this PR is the rule + guard. Refs #4940, #4949.
|
Caution Review failedThe pull request is closed. Finishing Touches
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #4954. Fixes #4940. Umbrella for #4949.
Deliverables (all four)
FASTLED_ALL_PINS_HARDWARE_SPI(feat(esp8266): expose hardware HSPI as Bus::SPI; retire FASTLED_ALL_PINS_HARDWARE_SPI (#4942) #4951),FASTLED_ESP8266_UART(feat(esp8266): UART WS2812 engine as Bus::UART; retire FASTLED_ESP8266_UART (#4944) #4952),FL_ESP8266_EMBEDDED_FS(feat(esp8266): embedded LittleFS is automatic; retire FL_ESP8266_EMBEDDED_FS (#4947) #4953). Each becomes a template-selectedBusTraits/backend with linker elimination.agents/docs/cpp-standards.md: new REQUIRED section"Driver selection is by template, never a code-enabling define" (the
BusTraits<Bus::X>/BusSupports<Bus::X, Chipset>shape, and why an opt-in#definedefeats both link-elimination and compile-verification, feat(channels): compile-time Bus binding via templated ChannelConfig (eliminates Channel API binary bloat) #2428).ci/lint_cpp/driver_enable_define_checker.py: flags apreprocessor guard that wraps a
platforms/...include undersrc/platforms/**in anFL_*/FASTLED_*macro. Guards shipping today aregrandfathered in
driver_enable_define_amnesty.txt; new ones fail.Registered in
run_all_checkers.py. It is Python-only because the rule needsthe guard and the line it protects — a per-line Rust pass cannot express it.
uv run ci/bloat.py esp8266on the stack vsmaster:image_flash 264,667 vs 264,671 B, RAM 6,808 vs 6,808 B → no regression
(unused engines dead-strip).
Test plan / evidence
pytest ci/tests/test_driver_enable_define_checker.py— 7 passed (flagged,allowed, scope, and a tree-wide "amnesty still covers src/platforms" guard).
PY_SMOKE(guard bumped 9 → 10 intest_native_ci_modes.py).ci/lint.py --strictclean on the touched files.Note: this PR is stacked on the conversions rather than under them so its
amnesty starts from the post-conversion tree; the three conversions merge first.