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 e3a2841 commit 2f5c6f5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@ jobs:
- name: Run clang-format and check code style
run: |
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
for file in $(ls src/*.[ch]); do
diff=$(clang-format -style=file "$file" | diff "$file" -)
echo "DIFF $diff"
if [ -n "$diff" ]; then
if [ ! -z "$diff" ]; then
echo "Style issues in $file:" >> clang-format-diff.txt
clang-format -style=file "$file" | diff -u "$file" - >> clang-format-diff.txt
fi
done < files_to_check.txt
done
echo "CIAOOA"
if [ -f clang-format-diff.txt ]; then
echo "ERROR in format"
echo "\nThe following files have style issues:" && cat clang-format-diff.txt
Expand Down

0 comments on commit 2f5c6f5

Please sign in to comment.