Swift toolchain formatter

Paid feature

Swift 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 in swift-format/Configuration.md.

Noctule provides a JSON schema to help edit the Swift formatter’s configuration:

  • Code completion
  • Quick documentation
  • Validation of properties