mirror of
https://github.com/esphome/esphome.git
synced 2026-05-21 16:13:51 +08:00
[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:
+5
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user