Merge remote-tracking branch 'origin/entity-types-xmacro' into integration

This commit is contained in:
J. Nick Koston
2026-04-09 14:57:57 -10:00
12 changed files with 274 additions and 1055 deletions
+1 -1
View File
@@ -672,7 +672,7 @@ def lint_using_esp_idf_deprecated(fname, line, col, content):
)
@lint_content_check(include=["*.h"])
@lint_content_check(include=["*.h"], exclude=["esphome/core/entity_types.h"])
def lint_pragma_once(fname, content):
if "#pragma once" not in content:
return (
+7 -1
View File
@@ -167,11 +167,17 @@ 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)
from esphome.writer import ENTITY_TYPES_H_TARGET
# X-macro files are included multiple times with different macro definitions
# and must not be included bare
exclude = {ENTITY_TYPES_H_TARGET}
# 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]