Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.60.1
- Fixed issue where
redundantSendablerule would unexpectedly removeSendableconformance on type defined in public extension - Fixed issue where
redundantSendablerule would leave behind extra space when removing: - Renamed
redundantPropertyrule toredundantVariable - Updated
redundantVariablerule to preserve variables with explicit type annotations - Updated
enumNamespacesrule to preserve Swift Testing suites as structs
0.60.0
- Added
redundantSwiftTestingSuiterule - Added
redundantSendablerule - Added
preferExpicitFalserule - Added support for
::module selector syntax - Added support for value generics syntax
- Updated
swiftTestingTestCaseNamesto use raw identifiers by default - Updated
swiftTestingTestCaseNamesto use UpperCamelCase for test suite names - Updated
redundantSelfto handleguardstatements - Updated
unusedArgumentsto handle for loop variables - Updated
redundantTypeto better handleSetliterals - Updated
redundantParentsto remove empty parens from attributes - Updated
sortImportsto sort imports by access control - Updated
blankLinesBetweenImportsto preserve indentation when indent disabled - Updated
unusedPrivateDeclarationrule to preserve private@Testfunctions - Updated
preferSwiftTestingrule to convert tests in extensions within the same file - Updated
--stdin-pathto not require the file to actually exist - Updated
simplifyGenericConstraintsto avoid adding duplicate constraints - Updated
blankLinesAroundMarkto insert blank line before MARK at start of scope when allowed byblankLinesAtStartOfScopeconfig - Updated
redundantEquatableto preserve==implementation in types withStrideableconformance - Fixed handling of switch statements with
#ifblocks in several rules - Fixed issue where
asyncfunction declarations were wrapped usingwrapArgumentsinstead ofwrapParameters - Fixed issue where
redudantViewBuilderwould remove@ViewBuilderfrom protocol members - Fixed
redundantSelfparsing issue with throwing closure return types and switch expressions inif letcondition - Fixed
trailingCommasrule incorrectly adding commas to if#availablechecks - Fixed
guard...elseindentation inwrapArgumentswithwrap-conditions - Fixed issue where
simplifyGenericConstraintswould leave danglingwherekeyword in protocol members - Fixed issue where
trailingCommasdidn't handle closure capture lists with macro expressions - Fixed indentation for closure parameters on separate lines
- Fixed issue where
.initwould be removed in code like[Foo].init { ... }(not supported until Swift 6.4). - Fixed issue where
.swift-versionfiles were read from excluded directories - Fixed incorrect replacement of
&&operator with,inside a ternary condition - Fixed
unusedArgumentsbug in code withtry? await - Fixed handling of
MainActorattributes inredundantViewBuilder
0.59.1
- Reverted changes to
indentrule--ifdefhandling from 0.59.0 - Updated
docCommentsrule to use doc comments on nested functions and handle conditional compilation blocks in function bodies - Updated
spaceAroundBracketsto preserve space between global actor attribute and closure capture list - Updated
redundantMemberwiseInitto preserve inits with attributes - Fixed handling of
anykeyword insortTypealiasesrule - Resolved build issue related to macOS 13 SDK availability
0.59.0
- Added
simplifyGenericConstraintsrule - Added
validateTestCasesrule - Added
testSuiteAccessControlrule - Added
wrapPropertyBodiesrule - Added
wrapFunctionBodiesrule - Added
redundantViewBuilderrule - Added
--ifdef preserveoption toindentrule - Added
--prefer-synthesized-init-for-internal-structsoption toredundantMemberwiseInitrule - Enabled more rules by default:
blankLinesBetweenImports,docComments,emptyExtensions,environmentEntry,noForceTryInTests,noForceUnwrapInTests,redundantAsync,redundantEquatable,redundantMemberwiseInit,redundantProperty,redundantThrows - Updated
typeSugarto only preserve explicitOptional<T>in structs with a synthesized memberwise initializer - Updated closing paren of single-argument functions and collections to wrap if needed
- Updated
redundantMemberwiseInitrule to support result builder attributes - Improved how
organizeDeclarationshandles structs with a synthesized memberwise initializer - Updated
docCommentsrule to preserve formatting of comments with directives - Fixed
--ifdef no-indenthandling of method chains and nested directives - Fixed issue where
XMLReporterdid not properly escape strings - Fixed support for
unsafekeyword - Fixed edge cases in
spaceAroundBracketsrule - Fixed crash in
sortTypealiasesrule - Fixed issue where
redundantSelfrule could crash if encountering a function with no body (e.g.@_silgen_name)
0.58.7
- Fixed
redundantSelfnot being applied insideif #available(...) { ... }clauses - Fixed
fileHeaderrule incorrectly setting creation year to current when file path contains spaces - Fixed mis-insertion for
nil-initrule related to optional closure return values - Fixed
unusedPrivateDeclarationsfalse positive when call site was outside enabled range - Fixed
sortImportsrule incorrectly moving// swift-tools-version:comment directive - Fixed
hoistTryrule sometimes producing mangled code when hoisting across line boundaries - Fixed crash in
--ruleinfocommand when rule options exceed the old max length requirement - Fixed crash in
unusedArgumentsdue to scope range bug
0.58.6
- Fixed
docCommentsnot being applied correctly after conditionalswitch...case - Trailing commas are no longer inserted inside
#selector(...)expressions - Source files listed with
--filelistare now formatted concurrently - Trailing comments are now kept with the same line when wrapping
- Fixed spurious
returnremoval insiderepeat...whileloops - Fixed bug with
trailingClosuresrule and property wrappers - Fixed performance regression introduced in 0.58.5
- Reduced timeout threshold to 1ms per token
0.58.5
- Fixed regression with indenting of macros (introduced in 0.58.4)
- Fixed spurious removal of
returnkeyword insidefor ... whereloops - Fixed parsing error with
for await case ...loops - Added
XCTUnwrapto the default exclusion list forhoistTry
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