Use clang-format-9 binary in Github Actions (#1088)

Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
This commit is contained in:
ellnor01
2021-01-04 15:20:55 +00:00
committed by GitHub
parent 5f869e1c98
commit 42d58be9a3

View File

@@ -2,12 +2,10 @@
# Arg used to specify non-'origin/master' comparison branch # Arg used to specify non-'origin/master' comparison branch
ORIGIN_BRANCH=${1:-"origin/master"} ORIGIN_BRANCH=${1:-"origin/master"}
CLANG_BINARY=${2:-"`which clang-format-9`"}
# Run git-clang-format to check for violations # Run git-clang-format to check for violations
if [ "$TRAVIS" == "true" ]; then CLANG_FORMAT_OUTPUT=$(git-clang-format --diff $ORIGIN_BRANCH --extensions c,cpp,h,hpp --binary $CLANG_BINARY)
EXTRA_OPTS="--binary `which clang-format-9`"
fi
CLANG_FORMAT_OUTPUT=$(git-clang-format --diff $ORIGIN_BRANCH --extensions c,cpp,h,hpp $EXTRA_OPTS)
# Check for no-ops # Check for no-ops
grep '^no modified files to format$' <<<"$CLANG_FORMAT_OUTPUT" && exit 0 grep '^no modified files to format$' <<<"$CLANG_FORMAT_OUTPUT" && exit 0