-
Notifications
You must be signed in to change notification settings - Fork 635
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
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
f5ec52c
to
1b53343
Compare
cae4d67
to
f36187b
Compare
8b0b9d0
to
a608072
Compare
f9e5a79
to
112174a
Compare
1389c1e
to
19bf26c
Compare
dbd22c8
to
c538be7
Compare
@nicklockwood, last time we chatted about this you said:
We didn't end up updating to Swift 5.7 for 0.55. How about we update to Swift 5.7 in 0.56, and then if nothing comes up we can update the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1837 +/- ##
===========================================
- Coverage 95.51% 95.51% -0.01%
===========================================
Files 139 139
Lines 25590 25590
===========================================
- Hits 24443 24442 -1
- Misses 1147 1148 +1 ☔ View full report in Codecov by Sentry. |
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).