Browse Source

Pin the SwiftFormat version in CI (#934)

Motivation:

Recent versions of SwiftFormat seem to have issues when loading
configuration files. This causes the lint check to unexpectedlty fail in
CI.

Modifications:

- Pin the SwiftFormat version in CI
- Ensure the exit code from the sanity script is bubbled up to the
  travis script

Result:

Formatting works in CI
George Barnett 5 years ago
parent
commit
7b31cfcf7a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      scripts/sanity.sh

+ 3 - 0
scripts/sanity.sh

@@ -29,6 +29,7 @@ function run_logged() {
   if $command > "$log" 2>&1; then
     printf "\033[0;32mOK\033[0m\n"
   else
+    errors=$(( errors + 1))
     printf "\033[0;31mFAILED\033[0m\n"
     echo "=== Captured output:"
     cat "$log"
@@ -45,5 +46,7 @@ function check_formatting() {
   run_logged "Checking formatting" "swiftformat --lint $HERE/.."
 }
 
+errors=0
 check_license_headers
 check_formatting
+exit $errors