Skip to content

Releases: nicklockwood/SwiftFormat

0.52.4

17 Sep 19:30
Compare
Choose a tag to compare
  • Fixed docComments rule incorrectly replacing comments inside switch cases and if/guard conditions
  • Fixed redundantLet rule removing required let inside ViewBuilder modifiers
  • Fixed redundantLet rule removing required let 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

02 Sep 09:41
Compare
Choose a tag to compare
  • 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

19 Aug 06:02
Compare
Choose a tag to compare
  • Fixed static Self being incorrectly removed in let or if let expressions
  • Fixed // swiftformat:disable directive not working for redundantReturn rule
  • Fixed spurious assertion failure

0.52.1

17 Aug 19:36
Compare
Choose a tag to compare
  • Fixed various bugs and edge cases in redundantStaticSelf rule
  • Fixed bug with redundantReturn rule for switch statements containing fallthrough
  • Fixed redundantReturn rule stripping required return from Void 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

13 Aug 18:01
Compare
Choose a tag to compare
  • Added redundantInternal rule to remove redundant internal access modifiers
  • Added sortTypealiases rule to sort typealias types alphabetically
  • Added headerFileName rule to ensure filename in header comment matches actual file
  • Added redundantStaticSelf rule to remove redundant self 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 to sortSwitchCases for consistency
  • Renamed sortedImports rule to sortImports 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

06 Aug 18:56
Compare
Choose a tag to compare
  • 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

18 Jul 18:51
Compare
Choose a tag to compare
  • 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 an if
  • 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 in organizeDeclarations rule

0.51.12

13 Jun 22:47
Compare
Choose a tag to compare
  • Fixed hoistTry bugs with generics, subscripts and collection literals
  • Fixed hoisting bugs with statements containing both try? and try
  • Fixed hoisting of try inside an optional function
  • Fixed function argument wrapping bug
  • Fixed bug where nested closure in was mistaken for part of a for 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 and discard operators
  • Added preliminary support for Swift 5.9 borrowing and consuming modifiers

0.51.11

29 May 18:59
Compare
Choose a tag to compare
  • 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 10 try expressions at the same scope level
  • Comments containing TODO: directives are no longer converted by the docComments rule

0.51.10

21 May 22:17
Compare
Choose a tag to compare
  • Fixed bug in wrapAttributes rule due to class declaration being mistaken for class-scoped var
  • Fixed another case of incorrect indenting inside an #ifdef block
  • Fixed linebreaks being incorrectly removed by sortedSwitchCases