Releases: nicklockwood/SwiftFormat
Releases · nicklockwood/SwiftFormat
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
0.51.15
- Fixed regression in
unusedArguments
rule that caused used parameters to be marked unused - Fixed some additional cases where regex literal was mistaken for
/
operator - Vertical tab and form feed characters in source file no longer cause spurious errors
(Note: this release includes the fixes that were supposed to be included in 0.51.14, but were omitted due to a merge error).
0.51.13
- Fixed bug where importing a type caused the
redundantSelf
rule to be silently disabled - Fixed bug where
unusedArguments
would remove an argument that was used after anif
- Fixed Windows support and added Windows release binaries (thanks to Saleem Abdulrasool)
- Fixed bug where backticks were incorrectly stripped from standalone
$
identifier - Added support for
package
keyword inorganizeDeclarations
rule
0.51.12
- Fixed
hoistTry
bugs with generics, subscripts and collection literals - Fixed hoisting bugs with statements containing both
try?
andtry
- Fixed hoisting of
try
inside an optional function - Fixed function argument wrapping bug
- Fixed bug where nested closure
in
was mistaken for part of afor
loop - Added preliminary support for wrapping Swift 5.9 macro declarations
- Added preliminary support for Swift 5.9
package
access modifier - Added preliminary support for Swift 5.9
consume
anddiscard
operators - Added preliminary support for Swift 5.9
borrowing
andconsuming
modifiers
0.51.11
- Fixed unexpected static function error false positive in
redundantSelf
rule - Fixed failure to report lint error when removing a duplicate blank line at the end of the file
- Fixed bug where
hoistTry
rule failed with more than 10try
expressions at the same scope level - Comments containing
TODO:
directives are no longer converted by thedocComments
rule
0.51.10
- Fixed bug in
wrapAttributes
rule due toclass
declaration being mistaken for class-scoped var - Fixed another case of incorrect indenting inside an
#ifdef
block - Fixed linebreaks being incorrectly removed by
sortedSwitchCases
0.51.9
- Fixed
typeSugar
rule unwrapping Optionalsome/any
without inserting required parentheses - Fixed indenting of function arguments inside an
#ifdef
block after a closing brace - Fixed comment directive state leaking between rules
0.51.8
- Fixed
redundantSelf
removing non-unwrapped weakself
inside closures - Fixed
fileprivate
rule makinginit
private when inherited by subclass in the same file - Fixed
hoistPatternLet
rule insertinglet
inside dictionary type literal - Fixed indenting for chained members inside conditional compilation blocks
- Fixed
unusedArguments
incorrectly removing used argument after conditional compilation block - Improved
unusedArguments
rule error handling