Swift Toolchain Formatter#
Paid featureSwift 6.0 and later provide a built-in code formatter.
The swift format command formats Swift files and is bundled with the Swift toolchain.
Format on Save#
Format on Save is supported for Swift’s code formatter. Please refer to External Code Formatters to learn how to set up your IDE.
.swift-format Configuration Files#
The command is configured with .swift-format files in the project directories.
The syntax of these files is documented on swift-format/Configuration.md.
Noctule provides a JSON schema to help edit the Swift formatter’s configuration:
- Code completion
- Quick documentation
- Validation of properties