Skip to content

fix(net): move NetworkDetector stub into fl::net namespace (#2817 lint follow-up) - #2829

Merged
zackees merged 1 commit into
masterfrom
fix/network-detector-namespace-2817
Jun 5, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/network-detector-namespace-2817

Conversation

@zackees

@zackees zackees commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Tiny lint follow-up to #2817. SubdirNamespaceChecker requires headers in src/fl/<subdir>/ to declare namespace fl::<subdir> - the cross-platform stub in src/fl/net/network_detector.h (added by #2817) was declaring its NetworkDetector class in namespace fl, triggering one persistent violation.

Move the stub into namespace fl::net and add a using alias in namespace fl so the existing consumers (fl::NetworkDetector::isAnyNetworkActive() in fl/channels/manager.cpp.hpp and fl/channels/driver.cpp.hpp) keep compiling without any churn.

The real RMT5 implementation lives in namespace fl at its own header (platforms/esp/32/drivers/rmt/rmt_5/network_detector.h) and is unaffected by this change.

Diff

-namespace fl {
+namespace fl::net {

 class NetworkDetector { /* stub: all returns false */ };

-} // namespace fl
+} // namespace fl::net
+
+// Back-compat: keep `fl::NetworkDetector` as a usable name in the
+// no-real-impl case.
+namespace fl {
+using NetworkDetector = ::fl::net::NetworkDetector;
+} // namespace fl

Test plan

  • bash lint --cpp - all C++ linting checks pass (was 1 violation on master, now 0).
  • Pure rename + alias, no behavior change. The stub class's body and static accessors are identical.

Cross-references

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Internal code organization improvements to better structure existing functionality without affecting user-facing behavior.

 follow-up)

The SubdirNamespaceChecker requires headers in src/fl/<subdir>/ to
declare namespace fl::<subdir>. The cross-platform stub in
src/fl/net/network_detector.h (added by #2817) was declaring the
NetworkDetector class in `namespace fl`, triggering a lint violation.

Move the stub into `namespace fl::net` and add a `using` alias in
`namespace fl` so the existing consumers (`fl::NetworkDetector` in
fl/channels/manager.cpp.hpp, fl/channels/driver.cpp.hpp) keep working
without any churn. The real RMT5 implementation already lives in
`namespace fl` at its own header and is unaffected.

Pure lint fix, no behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 5, 2026
@zackees
zackees merged commit 6dc3073 into master Jun 5, 2026
4 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown

Need an answer fast? Review this PR in Change Stack to ask focused questions about the PR or a changed range.

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: 8e4c96a0-0d38-4489-aff1-01efa51546aa

📥 Commits

Reviewing files that changed from the base of the PR and between 5714085 and 834341e.

📒 Files selected for processing (1)
  • src/fl/net/network_detector.h

📝 Walkthrough

Walkthrough

The PR relocates the stub implementation of NetworkDetector from the fl namespace into the fl::net namespace while preserving API compatibility through a back-compat alias, allowing existing code to continue using fl::NetworkDetector without modification.

Changes

Namespace Reorganization

Layer / File(s) Summary
NetworkDetector namespace relocation with backward-compatibility alias
src/fl/net/network_detector.h
The stub NetworkDetector class is moved into fl::net namespace, and a using NetworkDetector = ::fl::net::NetworkDetector; alias is added back under fl namespace to preserve the existing fl::NetworkDetector name for current call sites.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • FastLED/FastLED#2817: The main PR that renames/moves the NetworkDetector stub into fl::net while adding a fl::NetworkDetector alias back, which directly supports runtime calls to fl::NetworkDetector::isAnyNetworkActive() from the channel wait loops.

Poem

🐰 A namespace reshuffle, tidy and neat,
fl::net claims the detector's seat,
Yet backward we hop with an alias so kind,
Old call sites sleep soundly—no breaking behind!
Compatibility reigns, the rabbit grins wide. 🎯

✨ 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 fix/network-detector-namespace-2817

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.

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