[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.
This commit is contained in:
J. Nick Koston
2026-04-09 14:25:34 -10:00
parent 49fd95d672
commit 8791d9f26b
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -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<Area *, ESPHOME_AREA_COUNT> areas_{};
#endif
// Entity StaticVector fields (generated from entity_types.inc)
// NOLINTBEGIN(bugprone-macro-parentheses)
#define ENTITY_TYPE_(type, singular, plural, count, upper) StaticVector<type *, count> 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_proxy::SerialProxy *, SERIAL_PROXY_COUNT> serial_proxies_{};
+2
View File
@@ -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