- Options now use
--kebab-case
. Existing option names without dashes remain supported for backwards compatibility. Some options have been renamed to improve clarity. - Added support for
:this
and:previous
in comment directives. - Added support for formatting code blocks in Markdown files.
- Added support for multiple
--config
file arguments. - Added
singlePropertyPerLine
rule to convert property declarations defining multiple properties into separate declarations. - Added
redundantMemberwiseInit
rule to remove explicit memberwise initializers that are identical to thestruct
's compiler-synthesized initializer. - Added
redundantPublic
rule to remove public access control from properties of internal types. - Added
modifiersOnSameLine
rule to keep declaration modifiers on the same line. - Added
throwingTests
rule to prefer usingtry
andthrows
in unit tests rather thantry!
. - Added
noGuardInTests
rule to prefer convert guard statements in unit tests totry #require(...)
/#expect(...)
ortry XCTUnwrap(...)
/XCTAssert(...)
. - Added
urlMacro
rule to convertURL(string: "...")!
initializers to a provided#URL("...")
macro. - Added
--trailing-commas collections-only
and--trailing-commas multi-element-lists
options totrailingCommas
rule. - Added
--type-blank-lines insert
option toblankLinesAtStartOfScope
andblankLinesAtEndOfScope
rules. - Added
--wrap-string-interpolation
option to support disabling line wrapping within string interpolation. - Added
--line-between-guards
option toblankLinesAfterGuardStatements
rule. - Added support for SARIF output format.
- Improved performance of the
docComments
rule. - Fixed bug in
docComments
rule where trailing comments would be converted to doc comments. - Fixed bug where
redundantNilInit
rule would ignore type bodies with conformances. - Fixed bug where
wrapEnumCases
didn't handle some nested types correctly. - Fixed issue where
#
characters in config files couldn't be escaped. - Fixed issue where SwiftFormat for Xcode app would generate invalid config files with unescaped
#
characters. - Fixed issue where
--wrap-return-type never
didn't respect--allman true
.