diff --git a/.github/workflows/ensure-formatting.yaml b/.github/workflows/ensure-formatting.yaml index b85b89d0..4a9da6c8 100644 --- a/.github/workflows/ensure-formatting.yaml +++ b/.github/workflows/ensure-formatting.yaml @@ -15,4 +15,5 @@ jobs: - name: Test formatting for all files working-directory: ${{ github.workspace }} run: | + export CLANG_FORMAT_BIN='clang-format-15' ./scripts/check-format.sh \ No newline at end of file diff --git a/scripts/check-format.sh b/scripts/check-format.sh index e704e7e6..74289eb3 100755 --- a/scripts/check-format.sh +++ b/scripts/check-format.sh @@ -3,4 +3,6 @@ # 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 +CLANG_FORMAT_BIN="${CLANG_FORMAT_BIN:-clang-format}" + +find ./src ./test -iname '*.h' -o -iname '*.cpp' | xargs $CLANG_FORMAT_BIN -Werror -ferror-limit=1 --dry-run \ No newline at end of file