Skip to content

Commit

Permalink
Debug clang-format error
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelroquetto committed Sep 18, 2024
1 parent 624cedc commit a96dcc5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ jobs:

- name: Check Clang Format
run: |
# Check for modified C/C++ files
files=$(git diff --name-only origin/main...HEAD | grep -E '\.(c|cpp|h)$')
if [ -z "$files" ]; then
echo "No C/C++ files modified."
exit 0
fi
# Run clang-format and check for changes
clang-format -i $files
if ! git diff --exit-code $files; then
echo "Error: Some files are not formatted correctly. Please run clang-format on the modified files or use the provided pre-commit hook."
exit 1
fi
files=$(git diff --name-only origin/main...HEAD)
echo "Files to check: '$files'"

0 comments on commit a96dcc5

Please sign in to comment.