From 3c25d8ce544ca4defa4180464840e8804474b149 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 2 Oct 2023 23:46:35 +0200 Subject: [PATCH] Install clang-format-15 --- .github/workflows/ensure-formatting.yaml | 1 + scripts/check-format.sh | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ensure-formatting.yaml b/.github/workflows/ensure-formatting.yaml index b85b89d04..4a9da6c8b 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 e704e7e68..74289eb3a 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