Skip to content

Commit 51605e3

Browse files
Issue #10: Fix Code Style check action
1 parent a9c633f commit 51605e3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/pr-code-style-check.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,19 @@ jobs:
2929
3030
- name: Check formatting with clang-format
3131
run: |
32-
if echo "$FILES" | xargs clang-format --dry-run --Werror; then
33-
echo "✅ Code formatting is correct."
34-
else
35-
echo "❌ Code formatting issues found! Run 'clang-format -i <file>' before committing."
32+
ERROR=0
33+
for file in $FILES; do
34+
echo "🔍 Checking formatting for: $file"
35+
diff -u "$file" <(clang-format "$file") || ERROR=1
36+
done
37+
if [[ $ERROR -eq 1 ]]; then
38+
echo "❌ Formatting issues detected! Run 'clang-format -i <file>' to fix them."
3639
exit 1
40+
else
41+
echo "✅ Code formatting is correct."
3742
fi
3843
44+
3945
- name: Check code quality with clang-tidy
4046
run: |
4147
if [ -f "compile_commands.json" ]; then

0 commit comments

Comments
 (0)