From a98b6d20c1826b558573c0c44980d4d63d3e7165 Mon Sep 17 00:00:00 2001 From: gguidone Date: Thu, 9 Apr 2026 10:49:03 +0200 Subject: [PATCH] fix(clang-tidy): exclude test files from static analysis Test files include gtest/gtest.h which is not available in the clang-tidy build (px4_sitl_default-clang does not build test targets). The Makefile already had a comment noting test code should be excluded but the pattern was never added. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 066a36a0f4..dd1650c1ba 100644 --- a/Makefile +++ b/Makefile @@ -525,7 +525,7 @@ px4_sitl_default-clang: # 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|src/lib/drivers/smbus|src/drivers/gpio|src/modules/commander/failsafe/emscripten|failsafe_test\.dir|\.pb\.cc +CLANG_TIDY_EXCLUDE_EXTRA := src/systemcmds/tests|src/examples|src/modules/gyro_fft/CMSIS_5|src/lib/drivers/smbus|src/drivers/gpio|src/modules/commander/failsafe/emscripten|failsafe_test\.dir|\.pb\.cc|.*Test\.cpp CLANG_TIDY_EXCLUDE := $(CLANG_TIDY_SUBMODULES)|$(CLANG_TIDY_EXCLUDE_EXTRA) clang-tidy: px4_sitl_default-clang