From 8791d9f26bde03c4c7556afe097a6be837784cef Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 9 Apr 2026 14:25:34 -1000 Subject: [PATCH] [core] Add missing NOLINT suppression for bugprone-macro-parentheses clang-tidy flags macro arguments that aren't parenthesized, but wrapping template type arguments in parentheses would break C++ syntax. Add NOLINTBEGIN/END around the remaining macro blocks. --- esphome/core/application.h | 4 ++++ esphome/core/component_iterator.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/esphome/core/application.h b/esphome/core/application.h index 084cb643efb..6e4cdbc3465 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -273,6 +273,7 @@ class Application { const auto &get_areas() { return this->areas_; } #endif // Entity getter methods (generated from entity_types.inc) +// NOLINTBEGIN(bugprone-macro-parentheses) #define ENTITY_TYPE_(type, singular, plural, count, upper) \ auto &get_##plural() const { return this->plural##_; } \ GET_ENTITY_METHOD(type, singular, plural) @@ -281,6 +282,7 @@ class Application { #include "esphome/core/entity_types.inc" #undef ENTITY_TYPE_ #undef ENTITY_CONTROLLER_TYPE_ + // NOLINTEND(bugprone-macro-parentheses) #ifdef USE_SERIAL_PROXY auto &get_serial_proxies() const { return this->serial_proxies_; } @@ -462,12 +464,14 @@ class Application { StaticVector areas_{}; #endif // Entity StaticVector fields (generated from entity_types.inc) +// NOLINTBEGIN(bugprone-macro-parentheses) #define ENTITY_TYPE_(type, singular, plural, count, upper) StaticVector plural##_{}; #define ENTITY_CONTROLLER_TYPE_(type, singular, plural, count, upper, callback) \ ENTITY_TYPE_(type, singular, plural, count, upper) #include "esphome/core/entity_types.inc" #undef ENTITY_TYPE_ #undef ENTITY_CONTROLLER_TYPE_ + // NOLINTEND(bugprone-macro-parentheses) #ifdef USE_SERIAL_PROXY StaticVector serial_proxies_{}; diff --git a/esphome/core/component_iterator.h b/esphome/core/component_iterator.h index f855ab160f2..f1e2fe4d520 100644 --- a/esphome/core/component_iterator.h +++ b/esphome/core/component_iterator.h @@ -53,11 +53,13 @@ class ComponentIterator { NONE = 0, BEGIN, // Entity iterator states (generated from entity_types.inc) +// NOLINTBEGIN(bugprone-macro-parentheses) #define ENTITY_TYPE_(type, singular, plural, count, upper) upper, #define ENTITY_CONTROLLER_TYPE_(type, singular, plural, count, upper, callback) upper, #include "esphome/core/entity_types.inc" #undef ENTITY_TYPE_ #undef ENTITY_CONTROLLER_TYPE_ +// NOLINTEND(bugprone-macro-parentheses) #ifdef USE_API_USER_DEFINED_ACTIONS SERVICE, #endif