Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more flexible swiftformat version check to scripts/style.sh. #2334

Merged
merged 3 commits into from
Feb 1, 2019

Conversation

mikelehen
Copy link
Contributor

I'm not really proud of this PR, but it allows my swiftformat 0.38 to work, and should be forward-looking enough to not need to be changed again next week. :-)

scripts/style.sh Outdated
@@ -61,7 +61,7 @@ if [[ "$system" == "Darwin" ]]; then
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
if [[ "$version" != "0.32.0" && "$version" != "0.33"* && "$version" != "0.35"* && "$version" != "0.36"* && "$version" != "0.37"* && "$version" != "0.38"* && "$version" != "0.39"* && "$version" != "0.4"* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... what version does Travis have?

Initially there were just two versions because there was a lag between what we'd get on our desks and what was available to Travis. I think we slid down a (very) slippery slope when we started exempting more than the two.

What's the difference between this and no check at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My machine has 0.35.7. It seems that we're still not using enough Swift to trigger any differences from the versions.

I'm fine to stay flexible we're forced to get stricter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I said I'm not proud of this! I just knew it would solve my problem. 😛

How do we find out what version travis has?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a commit with the command swiftformat --version and check the travis output.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOUR SWIFT FORMAT VERSION IS: 0.35.7

Why are you shouting?

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any or all of these changes are fine with me as long as all of Firebase Swift is compatible with the version on Travis. cc: @ryanwilson

* Only log version in non-interactive builds.
* Use only mildly-terrible regex for version check.
* Include StorageViewController.swift change swiftformat makes (not sure yet if
  this will be compatible with travis swiftformat; CI will let me know!)
Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikelehen mikelehen merged commit 11b5ddb into master Feb 1, 2019
@mikelehen mikelehen deleted the mikelehen/fix-swiftformat branch February 1, 2019 22:21
bstpierr added a commit that referenced this pull request Feb 8, 2019
* master: (27 commits)
  Pass FSTMutations using a vector (#2357)
  Update CI to use CocoaPods 1.6.0 (#2360)
  Add NS_ASSUME_NONNULL_NOTATION for game center sign in (#2359)
  C++ migration: make all methods of `FSTRemoteStore` delegate to C++ (#2337)
  C++ migration: port write stream-related part of `FSTRemoteStore` (#2335)
  Resolve hard dependency of GameKit (#2355)
  Update gRPC certificate bundles locations for Firebase 5.16 (#2353)
  Start pod lib lint CI for IAM (#2347)
  Update library name to `fire-fiam`. (#2352)
  Bump FirebaseAnalyticsInterop version  (#2315)
  Add IAM headless to CI (#2341)
  C++ migration: port watch stream-related part of `FSTRemoteStore` (#2331)
  Open source FIAM headless SDK (#2312)
  Port flaky test fix from web. (#2332)
  Make scripts/style.sh compatible with newer swiftformat versions (0.38) (#2334)
  C++ migration: port `FSTOnlineStateTracker` (#2325)
  Don't build fuzz tests target on Travis (#2330)
  Remove FSTMutationQueue (#2319)
  C++ migration: port `FSTRemoteEvent` (#2320)
  C++ migration: port `FSTTargetChange` (#2318)
  ...
@firebase firebase locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants