Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
0.52.9
- Fixed
redundantClosure
removing required closure around conditional statements - Fixed
redundantClosure
removing closure containing conditional expressions inside a method call - Fixed
redundantClosure
generating invalid code when theredundantReturn
rule is disabled - Fixed issue where if/switch expressions with
as?
cast would break build in Swift 5.9 - Fixed
blankLineAfterImports
introducing spurious blank line before@preconcurrency
attribute - Fixed bug where
enumNamespaces
rule wouldn't be applied immediately after animport
statement - Fixed issue where
switch
case with multiplewhere
clauses could be parsed incorrectly - The SwiftFormat SPM plugin now formats local dependencies, not just final product targets
0.52.8
- Fixed
redundantClosure
rule in cases where anif
/switch
expression is not permitted - The
docComments
rule now correctly handles macro comments - The
docComments
rule is now only applied to a comment block if all lines match the pattern
0.52.7
- Fixed bug where
conditionalAssignment
andredundantClosure
rules would be applied incorrectly - Fixed
redundantClosure
rule leaving straytry
orawait
keywords behind
0.52.6
- Fixed bug where
redundantReturn
rule was incorrectly applied to consecutiveif
statements in Swift 5.9
0.52.5
- Fixed bug where
redundantReturn
rule could break fallible initializers in Swift 5.9 - Fixed incorrect application of
docComments
rule inside#if
statements - The
docComments
rule no longer treats comments starting withNote:
as a special directive - Fixed incorrect indenting inside
#if
statements immediately preceded by a comment - Removed arbitrary unwrap threshold for
braces
rule when no--maxwidth
is specified - You can now include operators in the
--asynccapturing
list
0.52.4
- Fixed
docComments
rule incorrectly replacing comments inside switch cases and if/guard conditions - Fixed
redundantLet
rule removing requiredlet
insideViewBuilder
modifiers - Fixed
redundantLet
rule removing requiredlet
after@MainActor
or@Sendable
- Fixed bug when using
--wrapconditions after-first
if first line of condition is a comment - Added more context to "failed to terminate" error message to aid tracking down issues
- Updated
sortTypealiases
rule to also remove duplicate protocols in declaration - Added some fixes to support parameter packs in Swift 5.9
0.52.3
- Fixed incorrect hoisting of
try
inside multiline string literal interpolations - Fixed incorrect hoisting of
try
inside generic type initializer calls - Fixed case where parens were incorrectly removed around optional function calls
- Fixed bug where early
return
statements added while debugging would be incorrectly removed
0.52.2
- Fixed static
Self
being incorrectly removed inlet
orif let
expressions - Fixed
// swiftformat:disable
directive not working forredundantReturn
rule - Fixed spurious assertion failure
0.52.1
- Fixed various bugs and edge cases in
redundantStaticSelf
rule - Fixed bug with
redundantReturn
rule for switch statements containingfallthrough
- Fixed
redundantReturn
rule stripping required return fromVoid
switch statements - Fixed some more cases where prefix
/
operator could be mistaken for a regex literal - The
redundantReturn
rule now handles statements containing comments or raw strings - Fixed spurious warning for unused options when using
--lintonly
rules - Including
/
operator in--nospaceoperators
or--nowrapoperators
now works again
0.52.0
- Added
redundantInternal
rule to remove redundantinternal
access modifiers - Added
sortTypealiases
rule to sorttypealias
types alphabetically - Added
headerFileName
rule to ensure filename in header comment matches actual file - Added
redundantStaticSelf
rule to remove redundantself
inside static functions - Added
blankLinesBetweenChainedFunctions
rule to remove blank lines inside function chains - Added
applicationMain
rule to remove obsolete@UIApplicationMain
and@NSApplicationMain
attributes - Renamed
sortedSwitchCases
rule tosortSwitchCases
for consistency - Renamed
sortedImports
rule tosortImports
for consistency - Redundant
return
is now correctly removed in switch cases with associated values - Fixed failure to terminate when removing returns from long switch statement
- Fixed spurious "unexpected static" error in
redundantSelf
rule - Deliberate blank line before
else
statement is now preserved - Rule options are now case-insensitive