checkstyle: ignore old clang-format (centos) 32/8532/2
authorKlement Sekera <ksekera@cisco.com>
Tue, 26 Sep 2017 00:39:40 +0000 (02:39 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Tue, 26 Sep 2017 16:11:31 +0000 (16:11 +0000)
Change-Id: Iecf35bd9fd760856e32eb1c0c9542ffbed472379
Signed-off-by: Klement Sekera <ksekera@cisco.com>
build-root/scripts/checkstyle.sh

index bd2ba81..6b760b3 100755 (executable)
@@ -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}