From d74007dc87ef243bfe4a70dda61e726bf902eff2 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Mon, 9 Feb 2026 16:15:00 -0800 Subject: [PATCH] clang-tidy: exclude NuttX-only drivers and emscripten from SITL analysis These files depend on platform headers (px4_platform/gpio/mcp.hpp, device::I2C, emscripten/emscripten.h) that are unavailable in the SITL/clang build, causing clang-tidy to report compiler errors: - src/lib/drivers/mcp_common (NuttX GPIO) - src/drivers/gpio (MCP23009, MCP23017) - src/lib/drivers/smbus (I2C bus driver) - src/modules/commander/failsafe/emscripten (emscripten SDK) Signed-off-by: Ramon Roche --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e3fd7d26f3..3fed0ae854 100644 --- a/Makefile +++ b/Makefile @@ -497,11 +497,14 @@ px4_sitl_default-clang: # - Test code (allowed looser style) # - Example code (educational, not production) # - Vendored third-party code (e.g., CMSIS_5) +# - NuttX-only drivers that depend on platform headers unavailable in SITL builds +# (MCP GPIO, SMBus/I2C) +# - Emscripten failsafe web build (requires emscripten SDK not present in container) # # To add manual exclusions, append to CLANG_TIDY_EXCLUDE_EXTRA below. # Submodules are automatically excluded - no action needed when adding new ones. CLANG_TIDY_SUBMODULES := $(shell git config --file .gitmodules --get-regexp path | awk '{print $$2}' | tr '\n' '|' | sed 's/|$$//') -CLANG_TIDY_EXCLUDE_EXTRA := src/systemcmds/tests|src/examples|src/modules/gyro_fft/CMSIS_5 +CLANG_TIDY_EXCLUDE_EXTRA := src/systemcmds/tests|src/examples|src/modules/gyro_fft/CMSIS_5|src/lib/drivers/mcp_common|src/drivers/gpio|src/lib/drivers/smbus|src/modules/commander/failsafe/emscripten CLANG_TIDY_EXCLUDE := $(CLANG_TIDY_SUBMODULES)|$(CLANG_TIDY_EXCLUDE_EXTRA) clang-tidy: px4_sitl_default-clang