diff --git a/.github/actions/clang-tidy-native/action.yml b/.github/actions/clang-tidy-native/action.yml index 19e2d36e..ac346014 100644 --- a/.github/actions/clang-tidy-native/action.yml +++ b/.github/actions/clang-tidy-native/action.yml @@ -6,7 +6,7 @@ inputs: required: false default: 'build' exclude: - description: 'Directories to exclude from analysis' + description: 'Directories to exclude from analysis (space-separated)' required: false default: '3rdparty' clang_tidy_version: @@ -31,9 +31,31 @@ runs: run: | git config --global --add safe.directory $GITHUB_WORKSPACE git fetch origin ${{ github.event.pull_request.base.ref }} - CHANGED_FILES=$(git diff --name-only \ + + # Check if .clang-tidy files were changed + CLANG_TIDY_CHANGED=$(git diff --name-only \ origin/${{ github.event.pull_request.base.ref }}...HEAD \ - -- '*.cpp' '*.hpp' '*.c' '*.h' | grep -v '^${{ inputs.exclude }}/' || true) + -- '**/.clang-tidy' || true) + + if [ -n "$CLANG_TIDY_CHANGED" ]; then + echo "::notice::.clang-tidy configuration changed, analyzing all source files" + # Find all source files in the repository (excluding specified directories) + CHANGED_FILES=$(find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h") + # Filter out excluded directories + for exclude_dir in ${{ inputs.exclude }}; do + CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v "^./${exclude_dir}/" || true) + done + else + # Only analyze changed source files + CHANGED_FILES=$(git diff --name-only \ + origin/${{ github.event.pull_request.base.ref }}...HEAD \ + -- '*.cpp' '*.hpp' '*.c' '*.h') + # Filter out excluded directories + for exclude_dir in ${{ inputs.exclude }}; do + CHANGED_FILES=$(echo "$CHANGED_FILES" | grep -v "^${exclude_dir}/" || true) + done + fi + echo "changed_files<> $GITHUB_OUTPUT echo "$CHANGED_FILES" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT diff --git a/.github/workflows/static-analysis-pr.yml b/.github/workflows/static-analysis-pr.yml index c0461f9b..f5808b5b 100644 --- a/.github/workflows/static-analysis-pr.yml +++ b/.github/workflows/static-analysis-pr.yml @@ -9,6 +9,7 @@ on: - '**/*.h' - '**/CMakeLists.txt' - '**/*.cmake' + - '**/.clang-tidy' - '.github/workflows/static-analysis-pr.yml' concurrency: @@ -59,7 +60,7 @@ jobs: uses: ./.github/actions/clang-tidy-native id: review with: - exclude: 3rdparty + exclude: "3rdparty build" clang_tidy_version: "20" - if: steps.review.outputs.total_comments > 0 run: | @@ -107,7 +108,7 @@ jobs: uses: ./.github/actions/clang-tidy-native id: review with: - exclude: 3rdparty + exclude: "3rdparty build docs_venv .git .pytest_cache .ruff_cache xml" clang_tidy_version: "20" - if: steps.review.outputs.total_comments > 0 run: | diff --git a/modules/task/tests/.clang-tidy b/modules/task/tests/.clang-tidy index ef43b7aa..9e502745 100644 --- a/modules/task/tests/.clang-tidy +++ b/modules/task/tests/.clang-tidy @@ -10,4 +10,4 @@ Checks: > CheckOptions: - key: readability-function-cognitive-complexity.Threshold - value: 50 # Relaxed for tests + value: 100 # Relaxed for tests diff --git a/modules/util/include/func_test_util.hpp b/modules/util/include/func_test_util.hpp index 9977ca97..6c00316b 100644 --- a/modules/util/include/func_test_util.hpp +++ b/modules/util/include/func_test_util.hpp @@ -91,7 +91,11 @@ class BaseRunFuncTests : public ::testing::TestWithParam& test_param) { task_ = std::get(test_param)(GetTestInputData()); + ExecuteTaskPipeline(); + } + /// @brief Executes the full task pipeline with validation. + void ExecuteTaskPipeline() { EXPECT_TRUE(task_->Validation()); EXPECT_TRUE(task_->PreProcessing()); EXPECT_TRUE(task_->Run()); diff --git a/modules/util/include/util.hpp b/modules/util/include/util.hpp index b914bcae..f8136a39 100644 --- a/modules/util/include/util.hpp +++ b/modules/util/include/util.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #ifdef __GNUG__