-
Notifications
You must be signed in to change notification settings - Fork 637
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 support for --swiftversion latest
#1227
Conversation
@calda thanks for adding this. When we use SwiftFormat in our project I think it's still best to specify the Swift version manually since we may not always be on the latest version of Swift supported by SwiftFormat. What do you think? |
Either is fine with me |
I feel like what would be nice is if we could pass the Swift version to the SwiftFormat tool at runtime (maybe we can?). Then our tooling that wraps SwiftFormat can determine the current version of Xcode we're using and pass it to SwiftFormat. |
@calda hmm, I realize the concept of stable vs beta Swift versions complicates this more than I anticipated. I assumed I did previously have an idea to try to automatically detect the Swift version, either by inspecting the files for modern features, or looking for a .xcodeproj or some other source of info. Maybe that's a better way to go? |
If you prefer to just use |
This is an interesting idea. For packages with a |
This PR adds support for specifying
--swiftversion latest
, to automatically use the most recent language version supported by SwiftFormat. Implements #1226.