From b7750b588c1d7ae9ea3891a254a39de5d3b3c572 Mon Sep 17 00:00:00 2001 From: Gil Date: Wed, 7 Mar 2018 09:59:38 -0800 Subject: Speed up source checks in Travis (#885) * Factor out a whitespace checking script * Factor out a copyright checking script * Rewrite lint.sh to honor revision ranges * Only restyle files that are part of the PR * Run C++ lint before builds to fail faster * Git grep doesn't operate on revision ranges * style.sh accepts clang-format 6 or 7 --- scripts/style.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/style.sh') diff --git a/scripts/style.sh b/scripts/style.sh index e2f8207..317c8c6 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -23,8 +23,12 @@ system=$(uname -s) -if [[ $(clang-format --version) != *"version 6"* ]]; then - echo "Please upgrade to clang-format version 6." +version=$(clang-format --version) +version="${version/*version /}" +version="${version/.*/}" +if [[ "$version" != 6 && "$version" != 7 ]]; then + # Allow an older clang-format to accommodate Travis version skew. + echo "Please upgrade to clang-format version 7." echo "If it's installed via homebrew you can run: brew upgrade clang-format" exit 1 fi -- cgit v1.2.3