Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.58.5
0.58.4
- Whitespace is no longer added or removed from blank lines in multiline string literals
- Fixed
trailingCommarule incorrectly inserting commas inside typedthrows - Fixed issue where
opaqueGenericParametersrule could cause build errors with existential types - Fixed false positive with
unusedArgumentswhen argument is only referenced inside a macro - The
noGuardInTestsrule now preserves custom failure messages - The
noGuardInTestsrule no longer addsthrowsto test methods when not needed - Removed redundant "default" values from options help descriptions
0.58.3
- Fixed parsing of
[n of X]syntax forInlineArrayin Swift 6.2 - Fixed parsing error when an opening multiline string delimiter is followed by a space
- Fixed issue where
redundantInitrule could leave orphaned parentheses - Fixed bug where
redundantInitwas incorrectly applied to(Foo.self as Bar.Type)expressions - Fixed bug with parsing empty property accessors that broke
redundantSelfrule - Fixed aliasing issue with
acronymsrule where one acronym overlaps another - Fixed unexpected wrapping of closing parenthesis in
wrapArgumentsrule - Added
--unknown-rulesoption to support environments with older SwiftFormat versions
0.58.2
- Fixed issue where
modifierOrderrule confusedasynceffect forasyncmodifier - Fixed issue where testing related rules incorrectly treated functions with arguments as test cases
- Updated
redundantInitrule to apply toinitcalls with single trailing closure - Updated
README.mdto reflect actual precedence behavior between.swift-versionfiles and--swift-versionarguments
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