Skip to content

chore(lint): clear 6 lint violations + accept ruff reformat - #3215

Merged
zackees merged 1 commit into
masterfrom
chore/lint-cleanup-stop-hook
Jun 18, 2026
Merged

zackees merged 1 commit into
masterfrom
chore/lint-cleanup-stop-hook

Conversation

@zackees

@zackees zackees commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Stop-hook lint flagged 6 violations (4 in PR #3211's new types.impl.hpp, 1 in screenmap.cpp.hpp, plus a 1-file ruff reformat). All cleared in one commit.

Changes

  1. src/fl/stl/json/types.impl.hpp -> types_impl.h — rename. ImplHppIncludesChecker forbids non-router files from including *.impl.hpp; types.h isn't a router. Renaming to types_impl.h removes the impl-suffix and the inline impl ships as a regular private header.
  2. src/fl/stl/json/types.h — moved the include from line 1760 (after } // namespace fl) to right above the namespace opening. Fixes IncludeAfterNamespaceChecker + NamespaceIncludesChecker.
  3. src/fl/stl/json/types_impl.h — json_bit_copy now uses fl::bit_cast_ptr<> instead of reinterpret_cast (matches the established src/fl/channels/detail/wave8.hpp pattern). Fixes ReinterpretCastChecker.
  4. src/fl/math/screenmap.cpp.hpp:373 — FL_WARN -> FL_WARN_F. Fixes LegacyLogMacroChecker.
  5. ci/autoresearch/phases.py — accept the ruff reformat (three long-line wraps in chained or args and print() calls).

Test plan

Source of violations: introduced by the recent merge of #3211 (fix(json): use integer float conversion for low-memory JSON) which landed without local C++ lint validation. Not flagged by GitHub CI because these checkers run as Stop-hook tooling rather than as a required GitHub check.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Internal code formatting and reorganization updates.
  • Refactor

    • Improved internal code safety mechanisms.

Pre-existing violations surfaced by the Stop hook lint run:

1. src/fl/stl/json/types.impl.hpp -> types_impl.h (rename).
   ImplHppIncludesChecker forbids non-router files from including *.impl.hpp.
   types.h is not a router file, so the include violated the rule.
   Renaming to types_impl.h removes the impl-suffix and the inline impl now
   ships as a regular private header.

2. src/fl/stl/json/types.h: include site moved from line 1760 (after the
   namespace fl closing brace) to right above the namespace fl opening.
   Fixes both IncludeAfterNamespaceChecker and NamespaceIncludesChecker.

3. src/fl/stl/json/types_impl.h: switch the two reinterpret_cast calls in
   json_bit_copy to fl::bit_cast_ptr (already used elsewhere in src/fl).
   Fixes ReinterpretCastChecker.

4. src/fl/math/screenmap.cpp.hpp:373 FL_WARN -> FL_WARN_F per
   LegacyLogMacroChecker.

5. ci/autoresearch/phases.py: accept the ruff-format reformat (three
   long-line wraps in argument-or-chains and print() calls).

Verified: bash lint --cpp clean (only pre-existing warn-only #2701
PlatformIO-internal-usage remains); bash test fl_stl_json --cpp passes.

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

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

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: 4eb2b2e7-fb6f-43f2-827d-b054c1f80148

📥 Commits

Reviewing files that changed from the base of the PR and between 8c885c3 and aebb084.

📒 Files selected for processing (4)
  • ci/autoresearch/phases.py
  • src/fl/math/screenmap.cpp.hpp
  • src/fl/stl/json/types.h
  • src/fl/stl/json/types_impl.h

📝 Walkthrough

Walkthrough

Three small C++ fixes: types.h moves its implementation include from the file's tail to the top and renames it to types_impl.h; types_impl.h replaces reinterpret_cast with fl::bit_cast_ptr in json_bit_copy; screenmap.cpp.hpp switches one log call from FL_WARN to FL_WARN_F. Separately, ci/autoresearch/phases.py receives cosmetic line-wrapping in three places.

Changes

C++ source changes

Layer / File(s) Summary
JSON include restructure and bit_cast_ptr usage
src/fl/stl/json/types.h, src/fl/stl/json/types_impl.h
types.h adds #include "fl/stl/json/types_impl.h" near the top and removes the trailing #include "fl/stl/json/types.impl.hpp"; types_impl.h uses fl::bit_cast_ptr instead of reinterpret_cast for the src/dst pointers in json_bit_copy.
ScreenMap warning macro update
src/fl/math/screenmap.cpp.hpp
The FASTLED_NO_JSON fallback in ScreenMap::toJson logs via FL_WARN_F instead of FL_WARN.

CI phases.py line-wrapping

Layer / File(s) Summary
Cosmetic line-wrap reformatting
ci/autoresearch/phases.py
Three statements are reformatted across multiple lines—the nxplpc environment= argument, the IEEE754 pin-skip print, and the IEEE754 CODEC TEST PASSED print—with identical runtime behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐇 A cast was recast, a WARN got an F,
The include now sits at the top of the shelf.
Some lines were re-wrapped, just tidier code,
No logic was changed on this bunny's abode.
Hop hop, all is well on the FastLED road! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: addressing lint violations and accepting code formatter updates.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/lint-cleanup-stop-hook

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 6bb90e1 into master Jun 18, 2026
11 checks passed
@zackees
zackees deleted the chore/lint-cleanup-stop-hook branch June 18, 2026 10:58
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 18, 2026
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