Skip to content

Commit

Permalink
Use dry-run to check for clang-format errors instead of inplace editing
Browse files Browse the repository at this point in the history
  • Loading branch information
Laupetin committed Oct 2, 2023
1 parent 55d0a83 commit 8ec83ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ensure-formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ jobs:
- name: Test formatting for all files
working-directory: ${{ github.workspace }}
run: |
./scripts/reformat-all.sh
[[ $(git status --porcelain | wc -l) == 0 ]]
./scripts/check-format.sh
6 changes: 6 additions & 0 deletions scripts/check-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Go to repository root
cd "$(dirname "$0")/.." || exit 2

find ./src ./test -iname '*.h' -o -iname '*.cpp' | xargs clang-format -Werror -ferror-limit=1 --dry-run

0 comments on commit 8ec83ba

Please sign in to comment.