Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.57.2
- Updated
trailingCommas
rule to handle function declarations with generic arguments. - Updated
--trailing-commas always
to preserve trailing commas rather than unnecessarily removing trailing commas in some edge cases. - Fixed spurious deprecation message when using some non-deprecated options.
0.57.1
- Fixed issue where trailing commas were unexpectedly removed from initializer argument lists when using
--trailing-commas always
. - Fixed issue where
redundantPublic
rule didn't handle extensions on types defined in public extensions. - Added
@Bindable
to list of SwiftUI property wrappers used byorganizeDeclarations
rule. - Fixed case-sensitivity issue with
preferFileMacro
rule.
0.57.0
- 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
.
0.56.4
- Fixed issue where
trailingCommas
rule would not insert trailing commas in function declarations with return type - Fixed issue where
trailingCommas
rule would not insert trailing commas in array literals following!
operator - Fixed issue where
unusedArguments
rule would ignore function declarations with trailing commas - Fixed issue where
void
rule would not handle()
types in typealiases - Fixed issue where
redundantLet
rule did not detect code inside result builders when nested in conditional compilation blocks
0.56.3
0.56.2
0.56.1
- Fixed several issues where
trailingCommas
rule would insert commas in places not actually supported by Swift 6.1 - Fixed issue where
--wrapeffects
option would incorrectly unwrapasync let
properties following function call - Fixed issue where
redundantEquatable
rule would incorrectly remove==
implementation in favor of synthesized implementation even if type contained non-Equatable properties like tuples - Fixed issue where
extensionAccessControl
rule would incorrectly hoistpublic
ACL in@preconcurrency
conformances - Fixed issue where
organizeDeclarations
rule would sometimes break property declarations with if expression values
0.56.0
- Added
wrapMultilineFunctionChains
rule to wrap chained method calls - Added
environmentEntry
rule to update SwiftUIEnvironmentValues
definitions to use the@Entry
macro - Added
redundantEquatable
rule to remove explicitEquatable
conformances that would be compiler-synthesized - Added
preferSwiftTesting
rule to migrate XCTest-based tests to Swift Testing - Added
swiftTestingTestCaseNames
rule to remove redundant "test" prefix from Swift Testing test case methods - Added
preferCountWhere
rule to prefercount(where:)
overfilter(_:).count
- Added
fileMacro
rule to prefer either#file
or#fileID
, which have the same behavior in Swift 6 and later - Added
blankLinesAfterGuardStatements
rule to remove blank lines between consecuitve guard statements, and add blank line after last guard statement. - Added
privateStateVariables
rule to addprivate
access control to@State
properties - Added
emptyExtensions
rule to remove extensions that contain no declarations or conformances - Added
--preserveacronyms
option toacronyms
rule - Added
--wrapreturntype never
option towrapArguments
rule - Updated
trailingCommas
to support Swift 6.1 trailing comma functionality opaqueGenericParameters
now supports protocol requirements without a body--wrapeffects
and--wrapreturntype
now support protocol requirements and closure types- Fixed indentation of trailing closures after chained multiline method call when using same-line closing parens
blankLinesAtStartOfScope
rule now supports switch cases and closure capture / parameter lists- Fixed issue where type under
organizeDeclarations
line count threshold would ignoreswiftformat:sort
directives - Fixed issue where
organizeDeclarations
rule would unexpectedly remove non-mark comments - Compiling SwiftFormat now requires Swift 5.7+
- SwiftFormat prerelease builds can now be installed via Homebrew using
brew install swiftformat --head
. Prerelease builds are subject to breaking changes.
0.55.6
- Fixed parsing bugs related to parameter packs (
repeat
,each
keywords) - Fixed bug where
propertyTypes
rule could cause build failure in properties withsome
type - Fixed bug where
--callsiteparen balanced
would have no effect when using--closingparen same-line
- Fatal error messages now include the name of the currently-running rule
- Docker build now uses Swift 6.0.3
0.55.5
- Fixed bug with
yodaConditions
rule mangling generic function calls - Fixed indenting of guard
else
or opening brace followingif
/switch
expression - The
organizeDeclarations
rule no longer treats properties withdidSet
as computed - Improved formatting support for async and throwing closures