Skip to content

Commit eec563a

Browse files
committed
Retrigger all files check if .clang-tidy file is modified
1 parent 4dab77d commit eec563a

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

.github/actions/clang-tidy-native/action.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,24 @@ runs:
3131
run: |
3232
git config --global --add safe.directory $GITHUB_WORKSPACE
3333
git fetch origin ${{ github.event.pull_request.base.ref }}
34-
CHANGED_FILES=$(git diff --name-only \
34+
35+
# Check if .clang-tidy files were changed
36+
CLANG_TIDY_CHANGED=$(git diff --name-only \
3537
origin/${{ github.event.pull_request.base.ref }}...HEAD \
36-
-- '*.cpp' '*.hpp' '*.c' '*.h' | grep -v '^${{ inputs.exclude }}/' || true)
38+
-- '.clang-tidy' '**/.clang-tidy' || true)
39+
40+
if [ -n "$CLANG_TIDY_CHANGED" ]; then
41+
echo "Clang-tidy configuration changed, analyzing all files"
42+
# Get all C++ files in the repo (excluding specified directories)
43+
CHANGED_FILES=$(find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" | \
44+
grep -v "^\./${{ inputs.exclude }}/" | sed 's|^\./||' || true)
45+
else
46+
# Only analyze changed C++ files
47+
CHANGED_FILES=$(git diff --name-only \
48+
origin/${{ github.event.pull_request.base.ref }}...HEAD \
49+
-- '*.cpp' '*.hpp' '*.c' '*.h' | grep -v '^${{ inputs.exclude }}/' || true)
50+
fi
51+
3752
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
3853
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
3954
echo "EOF" >> $GITHUB_OUTPUT

modules/task/tests/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Checks: >
1010
1111
CheckOptions:
1212
- key: readability-function-cognitive-complexity.Threshold
13-
value: 50 # Relaxed for tests
13+
value: 100 # Relaxed for tests

modules/util/include/func_test_util.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,26 @@ class BaseRunFuncTests : public ::testing::TestWithParam<FuncTestParam<InType, O
9292
void InitializeAndRunTask(const FuncTestParam<InType, OutType, TestType>& test_param) {
9393
task_ = std::get<GTestParamIndex::kTaskGetter>(test_param)(GetTestInputData());
9494

95+
ValidateTask();
96+
ExecuteTaskPipeline();
97+
VerifyOutput();
98+
}
99+
100+
private:
101+
void ValidateTask() {
95102
EXPECT_TRUE(task_->Validation());
103+
}
104+
105+
void ExecuteTaskPipeline() {
96106
EXPECT_TRUE(task_->PreProcessing());
97107
EXPECT_TRUE(task_->Run());
98108
EXPECT_TRUE(task_->PostProcessing());
109+
}
110+
111+
void VerifyOutput() {
99112
EXPECT_TRUE(CheckTestOutputData(task_->GetOutput()));
100113
}
101114

102-
private:
103115
ppc::task::TaskPtr<InType, OutType> task_;
104116
};
105117

modules/util/include/util.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <cstdint>
55
#include <cstdlib>
66
#include <memory>
7-
#include <source_location>
87
#include <string>
98
#include <typeinfo>
109
#ifdef __GNUG__

0 commit comments

Comments
 (0)