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 ed2fe9a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ jobs:
run: |
# Check for modified C/C++ files
files=$(git diff --name-only origin/main...HEAD | grep -E '\.(c|cpp|h)$')
echo "Files to check: '$files'"
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
exit 0
## 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

0 comments on commit ed2fe9a

Please sign in to comment.