From a24fc095e142994e184e8939d82d9ce571baa411 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 10 Jan 2018 19:10:54 -0800 Subject: [PATCH 1/7] Validate clang-format compliance in travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 18b04e2e2e6..9f3d3a796e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ before_install: script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files + - ./scripts/style.sh test-only # Validate clang-format compliance - ./test.sh # TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings From 3581e349c4e650528ee62a44f46407d1f8fa478b Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 10 Jan 2018 21:17:11 -0800 Subject: [PATCH 2/7] install clang-format on travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9f3d3a796e9..4a6ad230fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ before_install: - gem install xcpretty - bundle exec pod install --project-directory=Example --repo-update - bundle exec pod install --project-directory=Firestore/Example --no-repo-update + - brew install clang-format script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files From d7f1d93e94eeca4982fd4db1f89afa935ad62f23 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Thu, 11 Jan 2018 15:20:22 -0800 Subject: [PATCH 3/7] more logging to debug travis --- .travis.yml | 3 ++- scripts/style.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4a6ad230fea..e9fa9d67db4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,9 @@ before_install: script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files + - clang-format --version - ./scripts/style.sh test-only # Validate clang-format compliance - - ./test.sh +# - ./test.sh # TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings - bundle exec pod lib lint FirebaseCore.podspec --allow-warnings diff --git a/scripts/style.sh b/scripts/style.sh index 72f7520a138..640d4211156 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -21,6 +21,8 @@ # Commonly # ./scripts/style.sh master +set -x + if [[ $(clang-format --version) != **"version 6"** ]]; then echo "Please upgrade to clang-format version 6." echo "If it's installed via homebrew you can run: brew upgrade clang-format" @@ -65,7 +67,7 @@ fi # Format C-ish sources only \%\.(h|m|mm|cc)$% p -' | xargs clang-format -style=file $options | grep " /dev/null +' | xargs clang-format -style=file $options | grep " Date: Thu, 11 Jan 2018 19:12:59 -0800 Subject: [PATCH 4/7] more travis testing --- scripts/style.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/style.sh b/scripts/style.sh index 640d4211156..17eb9cb393a 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -67,7 +67,8 @@ fi # Format C-ish sources only \%\.(h|m|mm|cc)$% p -' | xargs clang-format -style=file $options | grep " Date: Fri, 12 Jan 2018 08:21:59 -0800 Subject: [PATCH 5/7] Exclude travis bundler files from style check --- .travis.yml | 3 +-- scripts/style.sh | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9fa9d67db4..4a6ad230fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,9 +16,8 @@ before_install: script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files - - clang-format --version - ./scripts/style.sh test-only # Validate clang-format compliance -# - ./test.sh + - ./test.sh # TODO fix os_log deprecation warning in FIRLogger to remove --allow-warnings - bundle exec pod lib lint FirebaseCore.podspec --allow-warnings diff --git a/scripts/style.sh b/scripts/style.sh index 17eb9cb393a..116c872823f 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -21,8 +21,6 @@ # Commonly # ./scripts/style.sh master -set -x - if [[ $(clang-format --version) != **"version 6"** ]]; then echo "Please upgrade to clang-format version 6." echo "If it's installed via homebrew you can run: brew upgrade clang-format" @@ -59,6 +57,9 @@ fi \%/third_party/% d \%/Firestore/Port/% d +# Sources pulled in by travis bundler +\%/vendor/bundle/% d + # Sources within the tree that are not subject to formatting \%^./(Example|Firebase)/(Auth|AuthSamples|Database|Messaging)/% d @@ -67,8 +68,7 @@ fi # Format C-ish sources only \%\.(h|m|mm|cc)$% p -' -#' | xargs clang-format -style=file $options | grep " /dev/null if [[ "$test_only" = true && $? -ne 1 ]]; then echo "Proposed commit is not style compliant. Run scripts/style.sh and git add the result." From 1eff84bc458978e126b0ff09f5038b9bf2b9ad54 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Sat, 13 Jan 2018 07:36:42 -0800 Subject: [PATCH 6/7] use travis's recommended brew install pattern --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4a6ad230fea..c31e4738d34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,8 @@ before_install: - gem install xcpretty - bundle exec pod install --project-directory=Example --repo-update - bundle exec pod install --project-directory=Firestore/Example --no-repo-update - - brew install clang-format + - brew update + - brew outdated clang-format || brew upgrade clang-format script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files From fa13e1801ef9320c1f177d93639c3c6b9fd1e579 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Sat, 13 Jan 2018 09:57:46 -0800 Subject: [PATCH 7/7] Revert "use travis's recommended brew install pattern" This reverts commit 1eff84bc458978e126b0ff09f5038b9bf2b9ad54. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c31e4738d34..4a6ad230fea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,7 @@ before_install: - gem install xcpretty - bundle exec pod install --project-directory=Example --repo-update - bundle exec pod install --project-directory=Firestore/Example --no-repo-update - - brew update - - brew outdated clang-format || brew upgrade clang-format + - brew install clang-format script: - "! git grep -I ' $'" # Fail on trailing whitespace in non-binary files