Closed lukasmalkmus closed 3 years ago
I specifically need/want this for macOS. I don't know how common Swift development on Linux is. However, if the Ubuntu env has Homebrew installed as well, it is as simple to install on Ubuntu than it is on macOS.
Hello @lukasmalkmus, We will consider adding this package. As soon as the final decision is ready, we will let you know.
Hi @lukasmalkmus, we already have few Swift formatter and linter tools, so we'd rather not add this new formatter. Please, use the following code to install it in runtime (it takes 2s without Homebrew):
wget https://github.com/nicklockwood/SwiftFormat/releases/download/0.47.13/swiftformat.zip
unzip swiftformat.zip
mv swiftformat /usr/local/bin/swiftformat
swiftformat --version
I am closing this issue, feel free to create a new one in case of any other questions.
Unfortunate. Which formatters are installed? For macOS 11.0, none is actually listed, apart from SwiftLint (which I use, but it is a linter, not a formatter). Even the official formatter by Apple (swift-format
) is not listed.
Sorry, my mistake, we don't have any formatter for Swift preinstalled on the image. Too many tools 😅 We'd like to add one then, and SwiftFormat seems to be more popular than swift-format, so I am re-opening the issue and moving it to our backlog. We will keep you posted with updates. Thanks!
@lukasmalkmus we've added SwiftFormat to the images! The new image rollout will start on Monday and take 3-4 days.
Thanks, appreciate the quick response and effort! 👍
@lukasmalkmus the image with SwiftFormat 0.47.13 has been deployed! I'm going to close the issue. Please feel free to contact us if you have any concerns. Thank you!
Tool information
swift-format
. Or the description from the README: "SwiftFormat is a code library and command-line tool for reformatting Swift code on macOS or Linux.SwiftFormat goes above and beyond what you might expect from a code formatter. In addition to adjusting white space it can insert or remove implicit self, remove redundant parentheses, and correct many other deviations from the standard Swift idioms."
swiftformat .
in any Swift code baseArea for Triage: Apple
Question, Bug, or Feature?: Feature
Virtual environments affected
Can this tool be installed during the build? Yes,
brew install swiftformat
Tool installation time in runtime ~25sec
Are you willing to submit a PR? Yes