-
Notifications
You must be signed in to change notification settings - Fork 125
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 swift-format version to 5.9 #175
Comments
Hi @takeshi-1000, this is a great catch - I don't personally like how it puts the code on the first line of the closure. Happy to hear it's fixed. Marking the issue as blocked, and we'll update to the new version of swift-format once Swift 5.9 is released. |
Hey! This is my first time interacting with the Open Source community on GitHub, so please let me know if I make any mistakes and/or come across as rude/annoying. It looks like swift-format 509.0.0 is available as of last week. I was playing around with swift-format 5.9 on my own project; and found out that having the swift-openapi-generator plugin active caused a conflict due to major version requirements of the package. This issue seems to be related to #250 as well. I would like to help if possible, would it be okay if I tried increasing the versions and opening a pull request? Thank you for your time. |
Hi @missingmario, welcome! We will require 5.9 at some point in the coming months, but aren't ready to do it yet. Can you speak to how this is impacting your project? The generator uses the |
Thank you @czechboy0 for the quick response! I have a swift package which I use inside for my app: MyProjectNetwork. I also have a separate swift package on a separate git repo (swift-myproject-openapi-client) which uses the generator as show in the code examples in this repo. I then added both swift-myproject-openapi-client and swift-format (from: 509.0.0) as dependencies to MyProjectNetwork. Xcode shows me the following error:
This makes sense to me as swift-format 508.y.z and 509.y.z are major versions and therefore may contain breaking changes according to SemVer. |
You're totally right, I didn't realize. Unfortunately, until we can bump to 5.9, you'll need to use swift-format 5.8. |
Oh, I'll wait then. There seems to be a workaround to use swift-format 509 if the generator is used inside a separate package: using the OpenAPIGeneratorCommand instead of the OpenAPIGenerator plugin and committing the generated files to source control prevents the swift-format 508 requirement from being passed on to the main project, allowing you to use swift-format 509 if needed. This might help anyone with the same problem as me. Thank you for your help! |
Indeed, using ahead-of-time generation keeps the generator's dependencies out of your package's dependencies: https://swiftpackageindex.com/apple/swift-openapi-generator/0.2.2/documentation/swift-openapi-generator/manually-invoking-the-generator-cli |
Already done in #331. |
Actually, we haven't yet bumped the repo itself to swift-format 5.9, reopening. |
Bump swift-format to 5.9 ### Motivation As per #175. ### Modifications Updated to swift-format 5.9, updated code to pass soundness. ### Result Using swift-format 5.9. ### Test Plan Soundness passed. Reviewed by: dnadoba Builds: ✔︎ pull request validation (5.10) - Build finished. ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (compatibility test) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (integration test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #340
Bump swift-format to 5.9 ### Motivation As per apple/swift-openapi-generator#175. ### Modifications Bump swift-format, update to make soundness pass. ### Result Using swift-format 5.9. ### Test Plan Soundness passed. Reviewed by: dnadoba Builds: ✔︎ pull request validation (5.10) - Build finished. ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #20
Bump swift-format to 5.9 ### Motivation As per apple/swift-openapi-generator#175. ### Modifications Bumped swift-format for CI, no other changes needed. ### Result Using swift-format 5.9. ### Test Plan Soundness passed. Reviewed by: dnadoba Builds: ✔︎ pull request validation (5.10) - Build finished. ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. #17
Done now. |
It seems that the following source code of Petstore was not properly formatted.
swift-openapi-generator/Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/Petstore/Server.swift
Line 86 in d22ddfe
The source code inside swift-openapi-generator seems fine and I've confirmed that if I raise the swift-format version to the current commit revision, it's formatted properly. There seems to be no release version currently available on the swift-format side, so I open this issue.
If you want to check, change the code as below,
and when you build it, an error will occur due to the change in the swift-format interface. (around here)
If you change the above code appropriately so that the build passes, and run the test, the output will be as follows.
Please note that the above behavior is the behavior of the current main branch of swift-format and is subject to change.
Thank you.
The text was updated successfully, but these errors were encountered: