fix clang-tidy

This commit is contained in:
Tomasz Duda 2024-08-14 17:34:29 +02:00
parent ff97ba9bb3
commit e541bd01cc
2 changed files with 2 additions and 31 deletions

View file

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

View file

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