Skip to content

Commit 49f8408

Browse files
committed
collect all error in format check
1 parent 476e09e commit 49f8408

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/format-check.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,32 @@ jobs:
2929

3030
- name: Check C++ code format
3131
run: |
32+
EXIT_CODE=0
3233
find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" -o -name "*.cc" -o -name "*.cxx" | \
3334
while read file; do
3435
if ! clang-format --dry-run --Werror "$file"; then
3536
echo "$file is not properly formatted"
3637
echo "Run: clang-format -i $file"
37-
exit 1
38+
EXIT_CODE=1
3839
fi
3940
done
41+
if [ $EXIT_CODE -ne 0 ]; then
42+
exit $EXIT_CODE
43+
fi
4044
echo "All C/C++ files are properly formatted"
4145
4246
- name: Check CMake code format
4347
run: |
48+
EXIT_CODE=0
4449
find . -name "CMakeLists.txt" -o -name "*.cmake" | \
4550
while read file; do
4651
if ! cmake-format --check "$file"; then
4752
echo "$file is not properly formatted"
4853
echo "Run: cmake-format -i $file"
49-
exit 1
54+
EXIT_CODE=1
5055
fi
5156
done
57+
if [ $EXIT_CODE -ne 0 ]; then
58+
exit $EXIT_CODE
59+
fi
5260
echo "All CMake files are properly formatted"

0 commit comments

Comments
 (0)