Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.58.1
- Fixed issue where
asynceffect could be confused forasyncmodifier, breakingdocCommentsBeforeModifiersrule in protocol body with async functions - Fixed issue where
wrapAttributesrule would unexpectedly wrapasynceffect - Fixed issue where
.swift-versionfile was ignored if not also using config file - Fixed issue where multiple trailing closure syntax could be applied to ineligible function calls
- Fixed issue where
redundantAsyncignoredawaitkeyword in string interpolation - Fixed bug where
acronymsrule would incorrectly always capitalize potentially matching acronyms one letter before end of identifier - Updated
redundantLetrule to handle#Previewmacro
0.58.0
- Added
noForceUnwrapInTestsrule - Added
redundantThrowsrule - Added
redundantAsyncrule - Added
preferFinalClassesrule - Added support for Swift 6.2 raw identifiers
- Updated
trailingCommasrule to handle cases now supported by Swift 6.2 - Updated
trailingClosuresrule to support multiple trailing closures - Added support for filtering config file options to a specific file path glob
- Added
--allow-partial-wrapping falseoption to disallow partial wrapping of functions and collections - Updated
propertyTypesrule to support array, dictionary, and set literals - Added
organizeDeclarationsthreshold options to organize types without adding marks - Added
--type-body-marks removeoption toorganizeDeclarations - Updated
organizeDeclarationsto support organizing protocol bodies - Added
--blank-line-after-switch-case alwaysoption toblankLineAfterSwitchCase - Added
--default-test-suite-attributesoption topreferSwiftTestingrule - Renamed
--markdown-filesoptions tostrictandlenient - Updated
redundantPublicrule to apply to private types - Updated
trailingClosuresandtrailingCommasrules to support optional function calls - Fixed bug where
markTypesrule wouldn't add marks after extensions - Fixed issue where
redundantPublicbroke@_spiannotated members - Improved parsing of nested markdown code blocks
- Fixed issue where
hoistTryrule could break@Testattribute - Fixed issue where
redundantVoidReturnTyperule could accidentally remove closure type - Fix
blankLinesAroundMarknot ignoring trailing comments at start of scope - Renamed
throwingTestsrule tonoForceTryInTests - Updated
singlePropertyPerLineto preserveasync letdeclarations
0.57.2
- Updated
trailingCommasrule to handle function declarations with generic arguments. - Updated
--trailing-commas alwaysto 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
redundantPublicrule didn't handle extensions on types defined in public extensions. - Added
@Bindableto list of SwiftUI property wrappers used byorganizeDeclarationsrule. - Fixed case-sensitivity issue with
preferFileMacrorule.
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
:thisand:previousin comment directives. - Added support for formatting code blocks in Markdown files.
- Added support for multiple
--configfile arguments. - Added
singlePropertyPerLinerule to convert property declarations defining multiple properties into separate declarations. - Added
redundantMemberwiseInitrule to remove explicit memberwise initializers that are identical to thestruct's compiler-synthesized initializer. - Added
redundantPublicrule to remove public access control from properties of internal types. - Added
modifiersOnSameLinerule to keep declaration modifiers on the same line. - Added
throwingTestsrule to prefer usingtryandthrowsin unit tests rather thantry!. - Added
noGuardInTestsrule to prefer convert guard statements in unit tests totry #require(...)/#expect(...)ortry XCTUnwrap(...)/XCTAssert(...). - Added
urlMacrorule to convertURL(string: "...")!initializers to a provided#URL("...")macro. - Added
--trailing-commas collections-onlyand--trailing-commas multi-element-listsoptions totrailingCommasrule. - Added
--type-blank-lines insertoption toblankLinesAtStartOfScopeandblankLinesAtEndOfScoperules. - Added
--wrap-string-interpolationoption to support disabling line wrapping within string interpolation. - Added
--line-between-guardsoption toblankLinesAfterGuardStatementsrule. - Added support for SARIF output format.
- Improved performance of the
docCommentsrule. - Fixed bug in
docCommentsrule where trailing comments would be converted to doc comments. - Fixed bug where
redundantNilInitrule would ignore type bodies with conformances. - Fixed bug where
wrapEnumCasesdidn'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 neverdidn't respect--allman true.
0.56.4
- Fixed issue where
trailingCommasrule would not insert trailing commas in function declarations with return type - Fixed issue where
trailingCommasrule would not insert trailing commas in array literals following!operator - Fixed issue where
unusedArgumentsrule would ignore function declarations with trailing commas - Fixed issue where
voidrule would not handle()types in typealiases - Fixed issue where
redundantLetrule 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
trailingCommasrule would insert commas in places not actually supported by Swift 6.1 - Fixed issue where
--wrapeffectsoption would incorrectly unwrapasync letproperties following function call - Fixed issue where
redundantEquatablerule would incorrectly remove==implementation in favor of synthesized implementation even if type contained non-Equatable properties like tuples - Fixed issue where
extensionAccessControlrule would incorrectly hoistpublicACL in@preconcurrencyconformances - Fixed issue where
organizeDeclarationsrule would sometimes break property declarations with if expression values
0.56.0
- Added
wrapMultilineFunctionChainsrule to wrap chained method calls - Added
environmentEntryrule to update SwiftUIEnvironmentValuesdefinitions to use the@Entrymacro - Added
redundantEquatablerule to remove explicitEquatableconformances that would be compiler-synthesized - Added
preferSwiftTestingrule to migrate XCTest-based tests to Swift Testing - Added
swiftTestingTestCaseNamesrule to remove redundant "test" prefix from Swift Testing test case methods - Added
preferCountWhererule to prefercount(where:)overfilter(_:).count - Added
fileMacrorule to prefer either#fileor#fileID, which have the same behavior in Swift 6 and later - Added
blankLinesAfterGuardStatementsrule to remove blank lines between consecuitve guard statements, and add blank line after last guard statement. - Added
privateStateVariablesrule to addprivateaccess control to@Stateproperties - Added
emptyExtensionsrule to remove extensions that contain no declarations or conformances - Added
--preserveacronymsoption toacronymsrule - Added
--wrapreturntype neveroption towrapArgumentsrule - Updated
trailingCommasto support Swift 6.1 trailing comma functionality opaqueGenericParametersnow supports protocol requirements without a body--wrapeffectsand--wrapreturntypenow support protocol requirements and closure types- Fixed indentation of trailing closures after chained multiline method call when using same-line closing parens
blankLinesAtStartOfScoperule now supports switch cases and closure capture / parameter lists- Fixed issue where type under
organizeDeclarationsline count threshold would ignoreswiftformat:sortdirectives - Fixed issue where
organizeDeclarationsrule 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.