-
Notifications
You must be signed in to change notification settings - Fork 636
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
Update minimum supported Swift version to Swift 5.7 #1837
base: develop
Are you sure you want to change the base?
Update minimum supported Swift version to Swift 5.7 #1837
Conversation
…ase it's too long or multiline
…erty has optional type
…e property's type is an existential, or if the RHS value has an infix operator
…ivate declarations (nicklockwood#1750) Co-authored-by: Cal Stephens <[email protected]>
…s after MARK comments (nicklockwood#1770)
…secutive groups of properties (nicklockwood#1795)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1837 +/- ##
===========================================
+ Coverage 94.15% 94.25% +0.10%
===========================================
Files 132 132
Lines 17128 17123 -5
===========================================
+ Hits 16127 16140 +13
+ Misses 1001 983 -18 ☔ View full report in Codecov by Sentry. |
Historically, the reason for wanting to keep the codebase building on very old versions was due to a quirk of how people integrated SwiftFormat into their projects. They either had to build it locally on their dev machine, or if they were using Cocoapods to install the binary then even though it was precompiled they were still limited to whatever version the podfile said was needed to build it. Since we don't have any analytics about which Xcode versions people are using it's difficult to tell what's safe. I guess an option would be to just bump the version to 5.7 for the next release, but without adopting any features into the code yet, and then see if anyone raises a ticket about it? If so we can roll the min version back in a point release. |
That makes sense and sounds reasonable. It would be nice to be able to land #1832, which requires Swift 5.3+. What if we do this:
What do you think @nicklockwood? Also, how should we do #3? If we update develop now, the code will inevitably stop compiling with the Swift versions we dropped. I guess that's ok though, since any issues would be easy enough to fix by hand later if necessary. We could avoid changing the |
@calda sorry for the delayed response. I'd suggest doing this in two steps:
If no issues arise during the SwiftFormat 0.55.x release cycle we can update the formatting version and start using 5.7-specific features in the codebase, but otherwise we'll roll back to 5.3 for now |
I see you did the Swift 5.3 update in b3b2610, thanks! |
8d6e356
to
34167b2
Compare
674a825
to
3f947f6
Compare
Based on the current set of CI jobs, SwiftFormat currently supports a minimum Swift version of Swift 5.2, which was released in Feb 2020.
In #1832, we had been talking about using multiple-trailing-closure syntax for a new feature. Multiple trailing closures were introduced in Swift 5.3, so to use this approach we have to update the minimum supported Swift version.
@nicklockwood, what are your general thoughts on what Swift versions should be supported by SwiftFormat?
We could just update to Swift 5.3+, which would lets us use trailing closures. I personally like the sound of Swift 5.7, since it adds a lot of extra functionality that we're missing in Swift 5.2 while still being somewhat older (released in September 2022).