Skip to content

clang-tidy on main again: the backends' findings of the five checks #176 turned on - #180

Merged
theAndreas merged 1 commit into
mainfrom
tidy/fix-main
Nov 14, 2026
Merged

theAndreas merged 1 commit into
mainfrom
tidy/fix-main

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

`main` has been red in the clang-tidy job since #176: the five checks it turned on find 15 things in `platform/esp32` and `platform/rp2350`. The survey of #175 missed them because clang-tidy names those sources relative to their PlatformIO project (`src/WebInterface.cpp`), and the count kept only paths with a folder of the repository in front.

Check Findings Answer
modernize-use-scoped-lock 7, ESP32 WordclockSerial `std::scoped_lock` by CTAD (plus the one in its host test)
old-style-cast + cstyle-cast 1, RP2350 WS2812Pio `pio_get_instance()` instead of the SDK's `pio0`/`pio1` casts; the host stub offers it
old-style-cast 2, `pdMS_TO_TICKS`, `HTTPD_DEFAULT_CONFIG` the casts are inside FreeRTOS's and the IDF's macros: NOLINT with that reason rather than re-implementing them
pro-type-const-cast 3, httpd `user_ctx` and WS payload httpd's types are non-const for the receiving path: NOLINT with the reason the code already gave
invalid-enum-default-initialization 1, RMT channel config zeroed as the IDF examples do, clock source set two lines later: NOLINT

Checked locally: `tools/tidy.sh` (all three targets, host tests, fuzzers) finds nothing, `make lint`, `make host-esp32 host-rp2350`, and `pio run` for both the ESP32 and the RP2350 build.

🤖 Generated with Claude Code

 turned on

#176 turned on bugprone-invalid-enum-default-initialization, clang-diagnostic-old-style-cast,
cppcoreguidelines-pro-type-const-cast, -pro-type-cstyle-cast and modernize-use-scoped-lock on
the strength of the survey of #175, and clang-tidy failed on main with 15 findings. The survey's
count missed them: clang-tidy names the ESP32's and the RP2350's sources relative to their
PlatformIO project, src/WebInterface.cpp, and the count kept only paths with a folder of the
repository in front.

- modernize-use-scoped-lock: std::scoped_lock, by CTAD, for the seven std::lock_guard of the
  ESP32's WordclockSerial, and the one of its host test along with them.
- old-style-cast and cstyle-cast in WS2812Pio: the block by pio_get_instance() rather than as
  pio0 or pio1, which the SDK defines as C casts of an address; the host tests' stub of
  hardware/pio.h offers it.
- old-style-cast in pdMS_TO_TICKS and HTTPD_DEFAULT_CONFIG: the casts are FreeRTOS's, inside
  the vendors' macros. A NOLINT with that reason, rather than writing the kernel's conversion
  or the server's defaults out again.
- pro-type-const-cast: httpd takes a user_ctx and a payload that are not const, for its
  receiving path; a NOLINT at each of the three, under the reason the code already gave.
- invalid-enum-default-initialization: the RMT channel's configuration is zeroed first, as
  the IDF's examples do, and its clock source set two lines later; a NOLINT with that reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@theAndreas
theAndreas merged commit 9cb38cf into main Nov 14, 2026
14 checks passed
@theAndreas
theAndreas deleted the tidy/fix-main branch November 14, 2026 09:16
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.

2 participants