1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 06:45:48 +00:00

clang-tidy

This commit is contained in:
Tomasz Duda
2024-08-09 20:00:41 +02:00
parent 355ff1cf4d
commit 0778cc3c72
10 changed files with 70 additions and 19 deletions

View File

@@ -236,7 +236,44 @@ def main():
files = split_list(files, args.split_num)[args.split_at - 1]
if args.all_headers and args.split_at in (None, 1):
build_all_include()
triplet = os.path.basename(idedata["cxx_path"])[:-4]
exclude_components = []
if "zephyr" in triplet:
exclude_components = [
"api",
"web_server_base",
"web_server",
"prometheus",
"captive_portal",
"socket",
"voice_assistant",
"homeassistant",
"bluetooth_proxy",
"wake_on_lan",
"esphome",
"e131",
"haier",
"improv_serial",
"lvgl",
"fingerprint_grow",
"md5",
"mlx90393",
"mqtt",
"online_image",
"sgp4x",
"wireguard",
"tuya",
"status",
"nextion",
"mqtt",
"improv_base",
"http_request",
"ota",
"wifi_info",
"wifi_signal",
"bedjet",
]
build_all_include(exclude_components)
files.insert(0, temp_header_file)
tmpdir = None

View File

@@ -29,7 +29,7 @@ def print_error_for_file(file, body):
print()
def build_all_include():
def build_all_include(exclude_components):
# Build a cpp file that includes all header files in this repo.
# Otherwise header-only integrations would not be tested by clang-tidy
headers = []
@@ -37,6 +37,9 @@ def build_all_include():
filetypes = (".h",)
ext = os.path.splitext(path)[1]
if ext in filetypes:
parts = path.split("/components/")
if len(parts) > 1 and parts[1].split("/")[0] in exclude_components:
continue
path = os.path.relpath(path, root_path)
include_p = path.replace(os.path.sep, "/")
headers.append(f'#include "{include_p}"')