Skip to content

format

Run SwiftFormat.

Runs SwiftFormat against the project, using the .swiftformat config generated by new.

Terminal window
swiftspawn format [--check]

A thin wrapper around swiftformat. Without flags, formats files in place. With --check, exits non-zero if formatting would change anything (useful in CI).

SwiftFormat must be installed separately (brew install swiftformat).

Terminal window
swiftspawn format
swiftspawn format --check
FlagDescription
--checkCheck-only mode; non-zero exit if formatting would change files.
CodeMeaning
5Not in a swiftspawn project.
6SwiftFormat not installed.

--check mode also returns non-zero from SwiftFormat itself when formatting would change files.