About
SwiftFormat is a code formatter for Swift that goes beyond adjusting white space. It can insert or remove implicit self, remove redundant parentheses, and correct many other deviations from standard Swift idioms. Its Xcode Source Editor Extension can be invoked from the Editor > SwiftFormat menu within Xcode. Xcode can also run SwiftFormat as a build phase, so it runs every time you press Cmd-R or Cmd-B.
The tool is useful for teams that want a shared coding style. Manually enforcing a common style is tedious, error-prone, and can lead to arguments among collaborators. An automatic formatter applies the same style consistently, so developers can focus on the behavior of the code rather than its presentation.
SwiftFormat is open source under the MIT license. The website also describes a command-line tool, a Git pre-commit hook, and other ways to run it, and the same codebase is available on macOS, Linux, and Windows.
What's new
All release notesHomebrew cask swiftformat-for-xcode 0.64.4 (sha256 3b2ed7965af2a41a13425f982d2980dbd843378382c6649ada8a8007a170df3c).