From ac14db7b1935603dcd9a8051dcb4cfc1e182f102 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Mon, 5 Sep 2016 18:33:25 +0200 Subject: [PATCH] linux: use clang-format-3.8 Default is potentially an old version --- linux_various/check_format.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linux_various/check_format.sh b/linux_various/check_format.sh index 3c460dd792..062c5a04ff 100755 --- a/linux_various/check_format.sh +++ b/linux_various/check_format.sh @@ -5,6 +5,18 @@ set -x ret=0 +if command -v clang-format-3.8 > /dev/null ; then + clang_format=clang-format-3.8 +else + if command -v clang-format > /dev/null ; then + clang_format=clang-format + else + return 2; + fi +fi + +$clang_format -version + # Doesn't work as travis only populate a single branch history #branch=`git rev-parse --abbrev-ref HEAD` @@ -64,7 +76,7 @@ files=`git diff --name-only --diff-filter=ACMRT $diff_range -- $PWD | \ # Check remaining files are clang-format compliant for f in $files do - clang-format -style=file -output-replacements-xml $f | grep "/dev/null + $clang_format -style=file -output-replacements-xml $f | grep "/dev/null if [ $? -ne 1 ] then echo "file $f did not match clang-format"