Code formatters
Noctule provides a native code formatter and also integrates with the popular SwiftFormat by Nick Lockwood and swift format, which ships with Swift 6 and later.
Formatting Swift sources
Native formatter
The formatting inside the editor is handled by Noctule’s native, built-in formatter.
Settings for the built-in formatter can be found at Preferences → Editor → Code Style → Swift (Noctule) .
This formatter is needed to provide a good editor experience. It handles indentation, reformatting after refactorings, and more. But it’s not yet as powerful as the other formatters.
If you rely on an external formatter, we recommend using “Format on Save”.
If you prefer to use an external formatter in the editor for Code → Reformat Code , please open a feature request on GitHub.
External formatters
Paid featureNoctule supports running external formatters when you save a Swift file.
You can configure the settings at Preferences → Languages & Frameworks → Swift (Noctule)
.
Three external formatters are supported: SwiftFormat, swift format of the Swift toolchain, and SwiftLint.
The “On Save” actions of your IDE are configured at Preferences → Tools → Actions on Save . The settings there are exactly the same as those on Noctule’s configuration page linked above.
The supported formatters are documented on their own pages:
- SwiftFormat by Nick Lockwood
- Swift Toolchain Formatter, the
swift formatcommand of Swift 6 and later - SwiftLint, which can also apply its corrections on save
Formatting Objective-C sources
Paid featureNative formatter
Noctule provides a native formatter for Objective-C files.
Settings for the built-in formatter can be found at Preferences → Editor → Code Style → Objective-C / C (Noctule) .