Skip to content

docs(review): forbid new FASTLED_* macros, require FL_* prefix - #3054

Merged
zackees merged 2 commits into
masterfrom
docs/forbid-new-fastled-macros
Jun 15, 2026
Merged

zackees merged 2 commits into
masterfrom
docs/forbid-new-fastled-macros

Conversation

@zackees

@zackees zackees commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Mark FASTLED_* as legacy / frozen vocabulary in both .coderabbit.yaml and the /code_review skill (.claude/commands/code_review.md).
  • Add a HIGH-severity rule that any newly introduced macro identifier with the FASTLED_ prefix is a violation; new macros must use FL_<COMPONENT>_<NAME>.
  • Extend the rule to platformio.ini build_flags (-D<NAME>=...), meson.build, CMakeLists.txt, and GitHub Actions YAML — not just C/C++ #define lines.
  • Existing FASTLED_* references in a diff are explicitly grandfathered; only brand-new identifiers trip the rule.

Triggered by an LPC example whose build_flags read:

build_flags =
    -DRELEASE
    -DFASTLED_LPC_PWM_DMA=1
    -DFASTLED_LPC_RX_SCT_WS2812=1

Under the new rule, those would be flagged and rewritten to -DFL_LPC_PWM_DMA=1 / -DFL_LPC_RX_SCT_WS2812=1.

Test plan

  • CodeRabbit picks up the new **/platformio.ini path block on the next PR with -DFASTLED_* build_flags
  • /code_review slash command surfaces the "New FASTLED_* macros (should be FL_*)" counter in its summary template
  • Sanity-check: a PR that only touches an existing FASTLED_* line (move/reformat) is NOT flagged

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated code review guidelines to enforce consistent macro naming, marking FASTLED_* as legacy-only and requiring new capability/config macros to use the FL_* format. Also tightened rules for how capability macro components should be spelled out.
  • Chores

    • Strengthened automated review checks to detect newly introduced FASTLED_* macro definitions and build flags across common build and CI configurations, ensuring they use the required FL_* naming.

Marks the FASTLED_* vocabulary as legacy-only / frozen in both the
CodeRabbit per-path review instructions and the /code_review skill.
Newly introduced macros — #define directives, -D build flags in
platformio.ini / meson.build / CMakeLists / workflow YAML, and
defined() checks — must use the FL_<COMPONENT>_<NAME> form instead.

Triggered by an FL_LPC_* example surfacing -DFASTLED_LPC_PWM_DMA=1 and
-DFASTLED_LPC_RX_SCT_WS2812=1 in build_flags; those would now be
flagged. Existing FASTLED_* references are grandfathered.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01f30086-d3ee-4c60-8eaa-1b954e8c365c

📥 Commits

Reviewing files that changed from the base of the PR and between a265f85 and fb13f54.

📒 Files selected for processing (2)
  • .claude/commands/code_review.md
  • .coderabbit.yaml
✅ Files skipped from review due to trivial changes (1)
  • .claude/commands/code_review.md

📝 Walkthrough

Walkthrough

Two review-tooling files are updated to enforce macro naming conventions. Both .coderabbit.yaml and .claude/commands/code_review.md now classify FASTLED_<NAME> macros as frozen legacy vocabulary, ban any newly introduced FASTLED_* identifiers (in source code and build flags across PlatformIO, Meson, CMake, and GitHub Actions), and require FL_<COMPONENT>_<NAME> for all new capability/config macros.

Changes

Macro Naming Enforcement in Review Tooling

Layer / File(s) Summary
CodeRabbit YAML macro naming enforcement across build systems
.coderabbit.yaml
Expands path-specific review instructions to classify FASTLED_<NAME> as frozen legacy vocabulary. Adds high-severity rules for source files, PlatformIO build_flags, Meson add_project_arguments, CMake add_compile_definitions, and GitHub Actions workflows, all banning newly introduced FASTLED_ identifiers via #define, -D flags, or preprocessor conditionals, requiring FL_<COMPONENT>_<NAME> form instead. Non-new FASTLED_* references are grandfathered.
Claude code review command macro enforcement and summary template
.claude/commands/code_review.md
Defines three formal macro categories, adds enforcement language banning new FASTLED_* macros and acronym-style component identifiers in Type-3 capability macros, introduces grep-based PR check steps to detect newly introduced FASTLED_ identifiers and -DFASTLED_ build flags alongside existing acronym checks, and extends the Summary output template with a dedicated counter for "New FASTLED_* macros (should be FL_*)".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2732: Directly related — updates the same .claude/commands/code_review.md and .coderabbit.yaml files to enforce FASTLED_* vs FL_* macro naming rules.
  • FastLED/FastLED#2741: Introduces FASTLED_OVERCLOCK identifiers in example code, which would be flagged as violations under the new enforcement rules added in this PR.

Poem

🐇 Hop hop, the macros must align,
No FASTLED_NEW shall cross the line!
FL_COMPONENT_* is the way to go,
Legacy names are frozen—don't you know.
The linter watches, grep in paw,
Enforcing naming with firm review law! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: enforcing a naming convention that forbids new FASTLED_* macros and requires FL_* prefix instead.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 docs/forbid-new-fastled-macros

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: 2

🤖 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 @.claude/commands/code_review.md:
- Around line 179-185: The checklist at lines 179-185 is missing an explicit
grep step for `defined(FASTLED_...)` and `#ifdef FASTLED_...` conditionals, even
though line 170 declares these forms are in scope for enforcement. Add a new
dedicated check step (it can be positioned as step 2 or 3) that greps the diff
for newly added lines matching `^\+.*defined\(FASTLED_` or
`^\+.*`#ifdef`\s+FASTLED_` and flag these as HIGH-severity violations requiring
the `FL_` prefix instead, ensuring the checklist operationalizes all rules
declared in the scope definition.

In @.coderabbit.yaml:
- Around line 63-81: The `.coderabbit.yaml` file currently defines the FASTLED_
vs FL_ prefix rule only for platformio.ini files, but the stated scope of this
coding policy applies across multiple build systems. Add equivalent path-based
instruction blocks to `.coderabbit.yaml` for meson.build, CMakeLists.txt, and
workflow YAML files that enforce the same FASTLED_ macro prefix rule with
HIGH-severity violations for newly added FASTLED_* identifiers. Adapt the
instruction text to reflect each build system's native syntax and conventions
while maintaining the same enforcement logic: flag only brand-new FASTLED_*
identifiers, not existing ones that are merely moved or reformatted.
🪄 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: 5b704a85-82dd-412b-8c7e-03dcc625838a

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1afa3 and a265f85.

📒 Files selected for processing (2)
  • .claude/commands/code_review.md
  • .coderabbit.yaml

Comment thread .claude/commands/code_review.md Resolved
Comment thread .coderabbit.yaml Resolved
Two findings from #3054 review:

1. /code_review checklist now operationalizes the `defined(FASTLED_*)` /
   `#ifdef FASTLED_*` / `#ifndef FASTLED_*` scope item — added step 3
   greps the diff for those preprocessor conditionals introducing brand-
   new identifiers.

2. .coderabbit.yaml now applies the same `FL_*` vs `FASTLED_*` rule to
   `**/meson.build`, `**/CMakeLists.txt`, and `.github/workflows/**`,
   each with build-system-specific examples (add_project_arguments,
   add_compile_definitions, env.CXXFLAGS, etc.). Previously only
   platformio.ini was covered.

Existing FASTLED_* identifiers remain grandfathered in every block.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@zackees
zackees merged commit 75b28fe into master Jun 15, 2026
1 check passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 15, 2026
@zackees
zackees deleted the docs/forbid-new-fastled-macros 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.

1 participant