Skip to content

Commit

Permalink
Update clang-format.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cpt-harlock authored Jan 2, 2025
1 parent 0409990 commit 33de6e1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ jobs:
- name: Run clang-format and check code style
run: |
touch clang-format-diff.txt
a=1
for file in $(ls src/*.[ch]); do
clang-format -style=file $file > temp
diff $file temp >> clang-format-diff.txt
diff $file temp > temp2
rm temp
size=$(du temp2 | sed 's/\t/ /g' | cut -d' ' -f1)
if [[ ! $size -eq 0 ]]; then
echo "ERROR in format for file $file"
a=1
fi
done
size=$(du src/pm.c | sed 's/\t/ /g' | cut -d' ' -f1)
if [[ ! $size -eq 0 ]]; then
echo "ERROR in format"
if [[ $a -eq 1 ]]; then
echo "Run clang-format -i src/*.[ch] in order to fix"
exit 1
fi
Expand Down

0 comments on commit 33de6e1

Please sign in to comment.