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 --- .travis.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 7c1c0b4..691d9d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,17 +30,18 @@ before_install: fi script: - # Fail on trailing whitespace in non-binary, non-generated-nanopb files - - "! git grep -I ' $' ':(exclude)Firestore/Protos/nanopb'" - - "! git grep -EL --name-only 'Copyright [0-9]{4}.*Google' | grep -v third_party | egrep '\\.(m|h|cc|mm|c)$'" - - ./scripts/style.sh test-only # Validate clang-format compliance + - ./scripts/check_whitespace.sh + - ./scripts/check_copyright.sh + - ./scripts/style.sh test-only $TRAVIS_COMMIT_RANGE - | - if [ $SKIP_FIREBASE != 1 ]; then - ./test.sh + # Google C++ style compliance + if [ $SKIP_FIRESTORE != 1 ]; then + ./scripts/lint.sh $TRAVIS_COMMIT_RANGE fi + - | - if [ $SKIP_FIRESTORE != 1 ]; then - ./scripts/lint.sh # Google C++ style compliance + if [ $SKIP_FIREBASE != 1 ]; then + ./test.sh fi - | if [ $SKIP_FIRESTORE != 1 ]; then -- cgit v1.2.3