diff --git a/.github/workflows/ensure-formatting.yaml b/.github/workflows/ensure-formatting.yaml index 8d306d1c..b85b89d0 100644 --- a/.github/workflows/ensure-formatting.yaml +++ b/.github/workflows/ensure-formatting.yaml @@ -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 ]] \ No newline at end of file + ./scripts/check-format.sh \ No newline at end of file diff --git a/scripts/check-format.sh b/scripts/check-format.sh new file mode 100755 index 00000000..e704e7e6 --- /dev/null +++ b/scripts/check-format.sh @@ -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 \ No newline at end of file