Skip to content

Commit e8842e3

Browse files
committed
Use git ls-files to select candidate files for clang format
This change ensures that the files being selected for clang format validation are exactly the ones tracked by the git repo we are testing. This protects against an known issue where the repo being tested contained "stray files" from a previous test.
1 parent 1edd250 commit e8842e3

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

Jenkinsfile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,16 +1127,16 @@ pipeline {
11271127
agent{ label rocmnode("nogpu") }
11281128
environment{
11291129
setup_args = "NO_CK_BUILD"
1130-
execute_cmd = "find .. -not -path \'*.git*\' -iname \'*.h\' \
1131-
-o -not -path \'*.git*\' -iname \'*.hpp\' \
1132-
-o -not -path \'*.git*\' -iname \'*.cpp\' \
1133-
-o -iname \'*.h.in\' \
1134-
-o -iname \'*.hpp.in\' \
1135-
-o -iname \'*.cpp.in\' \
1136-
-o -iname \'*.cl\' \
1130+
execute_cmd = "(cd .. && git ls-files \'*.h\' \
1131+
\'*.hpp\' \
1132+
\'*.cpp\' \
1133+
\'*.h.in\' \
1134+
\'*.hpp.in\' \
1135+
\'*.cpp.in\' \
1136+
\'*.cl\' \
11371137
| grep -v 'build/' \
11381138
| grep -v 'include/rapidjson' \
1139-
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-18 -style=file {} | diff - {}\' && \
1139+
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-18 -style=file {} | diff - {}\') && \
11401140
/cppcheck/build/bin/cppcheck ../* -v -j \$(nproc) -I ../include -I ../profiler/include -I ../library/include \
11411141
-D CK_ENABLE_FP64 -D CK_ENABLE_FP32 -D CK_ENABLE_FP16 -D CK_ENABLE_FP8 -D CK_ENABLE_BF16 -D CK_ENABLE_BF8 -D CK_ENABLE_INT8 \
11421142
-D __gfx908__ -D __gfx90a__ -D __gfx942__ -D __gfx1030__ -D __gfx1100__ -D __gfx1101__ -D __gfx1102__ \
@@ -1157,16 +1157,17 @@ pipeline {
11571157
agent{ label rocmnode("nogpu") }
11581158
environment{
11591159
setup_args = "NO_CK_BUILD"
1160-
execute_cmd = "find .. -not -path \'*.git*\' -iname \'*.h\' \
1161-
-o -not -path \'*.git*\' -iname \'*.hpp\' \
1162-
-o -not -path \'*.git*\' -iname \'*.cpp\' \
1163-
-o -iname \'*.h.in\' \
1164-
-o -iname \'*.hpp.in\' \
1165-
-o -iname \'*.cpp.in\' \
1166-
-o -iname \'*.cl\' \
1160+
execute_cmd = "(cd .. && git ls-files \
1161+
\'*.h\' \
1162+
\'*.hpp\' \
1163+
\'*.cpp\' \
1164+
\'*.h.in\' \
1165+
\'*.hpp.in\' \
1166+
\'*.cpp.in\' \
1167+
\'*.cl\' \
11671168
| grep -v 'build/' \
11681169
| grep -v 'include/rapidjson' \
1169-
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-18 -style=file {} | diff - {}\'"
1170+
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-18 -style=file {} | diff - {}\')"
11701171
}
11711172
steps{
11721173
buildHipClangJobAndReboot(setup_args:setup_args, setup_cmd: "", build_cmd: "", execute_cmd: execute_cmd, no_reboot:true)

0 commit comments

Comments
 (0)