Skip to content

Commit 4800f4c

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ jobs:
3131
run: |
3232
ERROR=0
3333
for file in $FILES; do
34-
echo "🔍 Checking formatting for: $file"
35-
diff -u "$file" <(clang-format "$file") || ERROR=1
34+
OUTPUT=$(clang-format --dry-run --Werror "$file" 2>&1)
35+
if [[ $? -ne 0 ]]; then
36+
echo "::error file=$file::$OUTPUT"
37+
ERROR=1
38+
fi
3639
done
3740
if [[ $ERROR -eq 1 ]]; then
3841
echo "❌ Formatting issues detected! Run 'clang-format -i <file>' to fix them."

0 commit comments

Comments
 (0)