diff --git a/Example/tvOSSample/tvOSSample/StorageViewController.swift b/Example/tvOSSample/tvOSSample/StorageViewController.swift index 2e91d92ae01..ed76d7641b7 100644 --- a/Example/tvOSSample/tvOSSample/StorageViewController.swift +++ b/Example/tvOSSample/tvOSSample/StorageViewController.swift @@ -42,7 +42,7 @@ class StorageViewController: UIViewController { } } - /// MARK: - Properties + // MARK: - Properties /// The current internal state of the view controller. private var state: UIState = .cleared { diff --git a/scripts/style.sh b/scripts/style.sh index 742c6069853..7565452e8d7 100755 --- a/scripts/style.sh +++ b/scripts/style.sh @@ -58,11 +58,17 @@ esac system=$(uname -s) if [[ "$system" == "Darwin" ]]; then version=$(swiftformat --version) + # Log the version in non-interactive use as it can be useful in travis logs. + if [[ ! -t 1 ]]; then + echo "Found: $version" + fi version="${version/*version /}" - # Allow an older swiftformat because travis isn't running High Sierra yet - # and the formula hasn't been updated in a while on Sierra :-/. - if [[ "$version" != "0.32.0" && "$version" != "0.33"* && "$version" != "0.35"* && "$version" != "0.37"* ]]; then - echo "Version $version installed. Please upgrade to at least swiftformat 0.33.8" + # Ensure the swiftformat version is at least 0.35.x since (as of 2019-02-01) + # travis runs 0.35.7. We may need to be more strict about version checks in + # the future if we run into different versions making incompatible format + # changes. + if [[ ! "$version" =~ ^0.3[5-9] && ! "$version" =~ ^0.[4-9] ]]; then + echo "Version $version installed. Please upgrade to at least swiftformat 0.35.0" echo "If it's installed via homebrew you can run: brew upgrade swiftformat" exit 1 fi