From 42d58be9a3b75fd11398d716f7e13a0fbc7499bd Mon Sep 17 00:00:00 2001 From: ellnor01 <51320439+ellnor01@users.noreply.github.com> Date: Mon, 4 Jan 2021 15:20:55 +0000 Subject: [PATCH] Use clang-format-9 binary in Github Actions (#1088) Signed-off-by: Ellen Norris-Thompson --- check-format.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/check-format.sh b/check-format.sh index 7eae2fdc..7de2bd2c 100755 --- a/check-format.sh +++ b/check-format.sh @@ -2,12 +2,10 @@ # Arg used to specify non-'origin/master' comparison branch ORIGIN_BRANCH=${1:-"origin/master"} +CLANG_BINARY=${2:-"`which clang-format-9`"} # Run git-clang-format to check for violations -if [ "$TRAVIS" == "true" ]; then - EXTRA_OPTS="--binary `which clang-format-9`" -fi -CLANG_FORMAT_OUTPUT=$(git-clang-format --diff $ORIGIN_BRANCH --extensions c,cpp,h,hpp $EXTRA_OPTS) +CLANG_FORMAT_OUTPUT=$(git-clang-format --diff $ORIGIN_BRANCH --extensions c,cpp,h,hpp --binary $CLANG_BINARY) # Check for no-ops grep '^no modified files to format$' <<<"$CLANG_FORMAT_OUTPUT" && exit 0