diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-09-26 02:39:40 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-09-26 16:11:31 +0000 |
commit | 8a398bbae279f07b1f9203721836b60dd1f39142 (patch) | |
tree | 7bcfc5ae7d848b451b164b1c9ac5b0a6e7e1ac77 /build-root/scripts/checkstyle.sh | |
parent | d94c3e5b3c9c7f6581a75f7ed9d6781e60932453 (diff) |
checkstyle: ignore old clang-format (centos)
Change-Id: Iecf35bd9fd760856e32eb1c0c9542ffbed472379
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'build-root/scripts/checkstyle.sh')
-rwxr-xr-x | build-root/scripts/checkstyle.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build-root/scripts/checkstyle.sh b/build-root/scripts/checkstyle.sh index bd2ba81371b..6b760b3a440 100755 --- a/build-root/scripts/checkstyle.sh +++ b/build-root/scripts/checkstyle.sh @@ -40,12 +40,19 @@ indent --version # Check to make sure we have clang-format. Exit if we don't with an error message, but # don't *fail*. command -v clang-format > /dev/null +HAVE_CLANG_FORMAT=0 if [ $? != 0 ]; then echo "Could not find command \"clang-format\". Checking C++ files will cause abort" - HAVE_CLANG_FORMAT=0 else - HAVE_CLANG_FORMAT=1 clang-format --version + x=$(echo "" | clang-format 2>&1) + if [[ "$x" == "" ]]; then + HAVE_CLANG_FORMAT=1 + else + echo "Output produced while formatting empty file (expected empty string):" + echo "$x" + echo "Could not find working \"clang-format\". Checking C++ files will cause abort" + fi fi cd ${VPP_DIR} |