aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/style.sh
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-03-07 09:59:38 -0800
committerGravatar GitHub <noreply@github.com>2018-03-07 09:59:38 -0800
commitb7750b588c1d7ae9ea3891a254a39de5d3b3c572 (patch)
treef90e211a858839ceb497e55b3edc475bf4b286f1 /scripts/style.sh
parent5930ad2feebc6628cbaec89b8f6a6146ed6afe5d (diff)
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
Diffstat (limited to 'scripts/style.sh')
-rwxr-xr-xscripts/style.sh8
1 files changed, 6 insertions, 2 deletions
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