SwiftFormat#
Paid featureSwiftFormat is a third-party formatter developed by Nick Lockwood.
The binary is usually named swiftformat. Please refer to the official instructions on how to install it.
Code Linting#
Problems highlighted by SwiftFormat’s linter are shown in the editor. Noctule provides a quick fix that reformats your file with SwiftFormat, applying its corrections for the highlighted problems.
Format on Save#
Format on Save is supported for SwiftFormat.
With Noctule, you can configure your IDE to reformat a file with SwiftFormat when you save it. Please refer to External Code Formatters to learn how to set up your IDE.
.swiftformat Configuration Files#
SwiftFormat is configured with .swiftformat files inside your Swift project.
The syntax of these files is documented on SwiftFormat/README.md.
Noctule supports them with the following features:
- Syntax highlighting of
.swiftformatfiles - Code completion of the available flags like
--indent - Code completion of rules after flags
--enable,--disableand--rules - Quick documentation on references to flags and rules
- Highlighting of references to unknown flags or rules
By default, files named .swiftformat and files with extension .swiftformat are mapped to Noctule’s file type “SwiftFormat Configuration”.
If you’re using additional configuration files, please use the .swiftformat extension if you would like the extended support.