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 fc56569 commit cb843ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ jobs:
- name: Run clang-format and check code style
run: |
# Find all C source and header files
find src/ -regex '.*\.[ch]' > files_to_check.txt
cat files_to_check.txt
# Run clang-format and collect the diff
while IFS= read -r file; do
diff=$(clang-format -style=file "$file" | diff "$file" -)
Expand All @@ -38,9 +37,12 @@ jobs:
done < files_to_check.txt
if [ -f clang-format-diff.txt ]; then
echo "\nThe following files have style issues:" >> $GITHUB_OUTPUT && cat clang-format-diff.txt >> $GITHUB_OUTPUT
echo "ERROR in format"
echo "\nThe following files have style issues:" && cat clang-format-diff.txt
echo "\nRun clang-format -i src/*.[ch] in order to fix" >> $GITHUB_OUTPUT
exit 1
else
echo "NO ERRORS"
fi
shell: bash

Expand Down

0 comments on commit cb843ef

Please sign in to comment.