[core] Exclude entity_types.h from clang-tidy all-include.cpp

The X-macro file requires macros to be defined before inclusion and
cannot be included bare in the clang-tidy all-include header.
This commit is contained in:
J. Nick Koston
2026-04-09 14:52:04 -10:00
parent f10f7c6b6a
commit 7d87b32033
+5 -1
View File
@@ -167,11 +167,15 @@ def build_all_include(header_files: list[str] | None = None) -> None:
cmd = ["git", "ls-files", "esphome/**/*.h"]
proc = subprocess.run(cmd, capture_output=True, text=True, check=True)
# X-macro files are included multiple times with different macro definitions
# and must not be included bare
exclude = {"esphome/core/entity_types.h"}
# Process git output - git already returns paths relative to repo root
header_files = [
line.replace(os.path.sep, "/")
for line in proc.stdout.strip().split("\n")
if line
if line and line.replace(os.path.sep, "/") not in exclude
]
headers = [f'#include "{h}"' for h in header_files]