Skip to content

chore(fl): move loose top-level fl/ files into fl/system/ - #2443

Merged
zackees merged 1 commit into
masterfrom
chore/move-fl-toplevel-into-system
May 10, 2026
Merged

zackees merged 1 commit into
masterfrom
chore/move-fl-toplevel-into-system

Conversation

@zackees

@zackees zackees commented May 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Relocates the last three loose files at src/fl/ root level into src/fl/system/, leaving only _build.cpp.hpp (unity-build glue) at the top of fl/.

Old path New path
src/fl/fastled.h src/fl/system/fastled.h
src/fl/fastled_internal.cpp.hpp src/fl/system/fastled_internal.cpp.hpp
src/fl/static_constexpr_defs.cpp.hpp src/fl/system/static_constexpr_defs.cpp.hpp

Updates ~45 consumers (sketches, drivers, lint scripts, IWYU pragmas, build glue, doc files) to the new include paths.

Build-glue changes

  • src/fl/_build.cpp.hpp no longer pulls in the two .cpp.hpp files directly — they're now picked up via src/fl/system/_build.cpp.hpp which already aggregates the system/ subdirectory.
  • src/fl/build/fl.cpp (the flat-fl/ unity build entry point) had only those two .cpp.hpps as content. With both moved, the file served no purpose and is removed. The unity-build manifest in ci/lint_cpp/test_unity_build.py is updated to match, and the five callsites that used fl.cpp as a clang-query / refactor target (ci/tools/check_noexcept.py, ci/tools/add_fl_noexcept.py, ci/refactor/add_fl_noexcept.py, and .claude/agents/cpp-linter-builder-agent.md) now point to fl.system+.cpp which covers the bulk of fl/ code.

Linter fix

_get_independently_compiled_dirs() now also registers ancestor directories of independently-compiled subdirs. Without this fix, removing fl.cpp made fl/ look "missing" from src/_build.cpp.hpp even though every subdir under fl/ is independently compiled via its own fl.X+.cpp recursive build entry.

Test plan

  • bash test --cpp --clean — 303/303 tests pass
  • bash lint --cpp — clean
  • CI green on PR

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Reorganized internal header structure across core and platform modules (~50+ files)
    • Updated build configuration and translation unit references to reflect new module organization
  • Chores

    • Updated tooling, error messages, and documentation to reflect internal path changes
    • Reorganized unity build include ordering for system modules

Review Change Stack

…pr_defs.cpp.hpp} into fl/system/

Relocates the last three loose files at src/fl/ root level into
src/fl/system/, leaving only `_build.cpp.hpp` (unity-build glue) at
the top of fl/.

Moves:
  src/fl/fastled.h                   -> src/fl/system/fastled.h
  src/fl/fastled_internal.cpp.hpp    -> src/fl/system/fastled_internal.cpp.hpp
  src/fl/static_constexpr_defs.cpp.hpp -> src/fl/system/static_constexpr_defs.cpp.hpp

Updates ~45 consumers (sketches, drivers, lint scripts, IWYU pragmas,
build glue, doc files) to the new include paths.

Build glue:
  - `src/fl/_build.cpp.hpp` no longer pulls in the two .cpp.hpp files
    directly; they're now picked up via `src/fl/system/_build.cpp.hpp`
    which already aggregates the system/ subdirectory.
  - `src/fl/build/fl.cpp` (the flat-fl/ unity build entry point) had
    only those two .cpp.hpp's as content. With both moved, the file
    served no purpose and is removed. The unity-build manifest in
    `ci/lint_cpp/test_unity_build.py` is updated to match, and the
    five callsites that used `fl.cpp` as a clang-query target
    (`ci/tools/check_noexcept.py`, `ci/tools/add_fl_noexcept.py`,
    `ci/refactor/add_fl_noexcept.py`, `.claude/agents/cpp-linter-builder-agent.md`)
    now point to `fl.system+.cpp` which covers the bulk of fl/ code.

Linter fix:
  - `_get_independently_compiled_dirs()` now also registers ancestor
    directories of independently-compiled subdirs. Without this fix,
    removing `fl.cpp` made `fl/` look "missing" from `src/_build.cpp.hpp`
    even though every subdir under `fl/` is independently compiled via
    its own `fl.X+.cpp` recursive build entry.

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

coderabbitai Bot commented May 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 43864bb4-563a-45e7-bcba-971ec10b021f

📥 Commits

Reviewing files that changed from the base of the PR and between 33fa0fd and 286e4c0.

📒 Files selected for processing (52)
  • .claude/agents/cpp-linter-builder-agent.md
  • ci/lint_cpp/fastled_header_usage_checker.py
  • ci/lint_cpp/test_unity_build.py
  • ci/refactor/add_fl_noexcept.py
  • ci/tools/add_fl_noexcept.py
  • ci/tools/check_noexcept.py
  • cpp_lint.py
  • src/FastLED.h
  • src/cled_controller.cpp.hpp
  • src/colorpalettes.cpp.hpp
  • src/crgb.cpp.hpp
  • src/dmx.h
  • src/fastled_delay.cpp.hpp
  • src/fastspi.h
  • src/fastspi_nop.h
  • src/fastspi_ref.h
  • src/fl/_build.cpp.hpp
  • src/fl/audio/fft/fft_impl.cpp.hpp
  • src/fl/build/fl.cpp
  • src/fl/channels/validation.cpp.hpp
  • src/fl/fx/1d/particles.cpp.hpp
  • src/fl/fx/2d/luminova.cpp.hpp
  • src/fl/fx/2d/noisepalette.cpp.hpp
  • src/fl/gfx/blur.cpp.hpp
  • src/fl/gfx/colorutils.cpp.hpp
  • src/fl/gfx/five_bit_hd_gamma.cpp.hpp
  • src/fl/gfx/noise/noise.cpp.hpp
  • src/fl/gfx/rgbw.cpp.hpp
  • src/fl/math/ease.cpp.hpp
  • src/fl/sensors/pir.cpp.hpp
  • src/fl/system/_build.cpp.hpp
  • src/fl/system/fastled.h
  • src/fl/system/fastled_internal.cpp.hpp
  • src/fl/system/static_constexpr_defs.cpp.hpp
  • src/fl/task/task.h
  • src/hsv2rgb.cpp.hpp
  • src/lib8tion.cpp.hpp
  • src/noise.cpp.hpp
  • src/pixelset.h
  • src/platforms/arm/rp/rpcommon/clockless_rp_pio_auto.cpp.hpp
  • src/platforms/arm/teensy/teensy4_common/clockless_objectfled.cpp.hpp
  • src/platforms/arm/teensy/teensy4_common/rx_flexpwm_channel.cpp.hpp
  • src/platforms/compile_test.cpp.hpp
  • src/platforms/esp/32/drivers/lcd_cam/clockless_lcd_i80_esp32.cpp.disabled
  • src/platforms/esp/32/drivers/lcd_cam/clockless_lcd_rgb_esp32.cpp.disabled
  • src/platforms/shared/spi_bitbang/generic_software_spi.h
  • src/platforms/stub/compile_test.hpp
  • src/platforms/stub/fastspi_stub_generic.cpp.hpp
  • src/power_mgt.h
  • src/simplex.cpp.hpp
  • src/wiring.cpp.hpp
  • test_rmt.cpp

📝 Walkthrough

Walkthrough

This PR systematically refactors FastLED's internal header structure by relocating the core internal header from fl/fastled.h to fl/system/fastled.h. The change reorganizes unity-build composition, removes the now-empty fl/build/fl.cpp wrapper, and updates approximately 60 files (implementation files, build tools, lint rules, and documentation) to reference the new path throughout the codebase.

Changes

Header Path and Build Structure Refactor

Layer / File(s) Summary
Header Architecture
src/fl/system/fastled.h, .claude/agents/cpp-linter-builder-agent.md
Documentation updated to reflect fl/system/fastled.h as the internal header path; clang-query TU mapping examples reference src/fl/build/fl.system+.cpp.
Unity Build Reorganization
src/fl/build/fl.cpp, src/fl/_build.cpp.hpp, src/fl/system/_build.cpp.hpp
Removed entire unity wrapper from fl.cpp; removed direct includes of fastled_internal.cpp.hpp and static_constexpr_defs.cpp.hpp from fl/_build.cpp.hpp; reorganized fl/system/_build.cpp.hpp to include and order these moved implementation files.
Build Tool Updates
ci/refactor/add_fl_noexcept.py, ci/tools/add_fl_noexcept.py, ci/tools/check_noexcept.py
Updated clang-query TU scope mappings to use src/fl/build/fl.system+.cpp instead of src/fl/build/fl.cpp.
Build Validation & Lint Rules
ci/lint_cpp/test_unity_build.py, ci/lint_cpp/fastled_header_usage_checker.py, cpp_lint.py
Removed fl/build/fl.cpp from expected build files; enhanced ancestor-directory detection logic; updated all documentation and error messages to require fl/system/fastled.h instead of fl/fastled.h.
Systematic Include Migrations
src/FastLED.h, src/*.cpp.hpp, src/fl/**/*.cpp.hpp, src/platforms/**/*.{h,cpp.hpp}, test_rmt.cpp
Updated approximately 50 files to include fl/system/fastled.h instead of fl/fastled.h while preserving all existing functionality, logic, and API behavior.
Usage Examples & Backdoor Documentation
src/fl/task/task.h
Updated inline usage examples and backdoor function comments to reference the new header path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • FastLED/FastLED#2414: Modifies unity-build validation and build-entrypoint plumbing, including changes to ci/lint_cpp/test_unity_build.py and src/fl/build/fl.cpp.
  • FastLED/FastLED#2335: Modifies src/fl/build/fl.cpp and adjusts unity-build translation unit mappings.
  • FastLED/FastLED#2401: Updates src/FastLED.h main include and adjusts unity-build composition in src/fl/build/fl.cpp.

Poem

🐰 Headers march toward the /system tree,
A thousand includes find their new decree,
From fl to system, the paths align,
Each build rewoven with methodical design,
Tooling and tests all dance in sync—
The refactor is elegant, I dare not blink! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/move-fl-toplevel-into-system

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.

@zackees
zackees merged commit 1dd63a1 into master May 10, 2026
5 of 7 checks passed
@zackees
zackees deleted the chore/move-fl-toplevel-into-system branch May 30, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant