Skip to content

Releases: nicklockwood/SwiftFormat

0.53.2

17 Feb 17:44
Compare
Choose a tag to compare
  • Fixed bug where hoistAwait rule could move await before try keyword
  • Fixed bug where redundantSelf rule was confused by @MainActor annotation
  • Fixed edge case where unusedArguments removed required argument inside guard

0.53.1

26 Jan 18:51
Compare
Choose a tag to compare
  • Fixed bug where fileHeader could duplicate headers containing a colon
  • The redundantInternal rule no longer strips internal from import statements
  • Fixed false positive with unusedArguments rule

0.53.0

08 Jan 19:23
Compare
Choose a tag to compare
  • Added preferForLoop rule to convert forEach { ... } calls to regular for loops
  • Added wrapLoopBodies rule to wrap single-line loop bodies over multiple lines
  • Added noExplicitOwnership rule to remove unwanted borrowing and consuming modifiers
  • Added wrapMultilineConditionalAssignment rule to wrap if or switch expressions to new line
  • The wrapAttributes rule no longer unwraps attributes if they would exceed --maxwidth
  • The typeSugar rule's --shortoptionals option now defaults to except-properties
  • Enabled blankLinesBetweenChainedFunctions rule by default
  • Enabled blankLineAfterImports rule by default
  • Fixed self being incorrectly inserted before set clause in computed properties
  • Fixed a bug in parseType() helper function where qualified types were not recognized
  • Fixed Xcode command plugin

0.52.11

06 Dec 00:17
Compare
Choose a tag to compare
  • Updated if/switch expression workaround for Swift 5.9 bug to handle as! casts
  • Fixed indent logic for wrapped conditional assignment expressions
  • Fixed assertion failure in redundantSelf rule
  • Fixed raw string parsing bug

0.52.10

14 Nov 23:18
Compare
Choose a tag to compare
  • Fixed enumNamespaces rule breaking import struct/class statements
  • Fixed unsafe application of conditionalAssignment rule to switch statements containing #if blocks

0.52.9

11 Nov 08:24
Compare
Choose a tag to compare
  • 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 the redundantReturn 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 an import statement
  • Fixed issue where switch case with multiple where clauses could be parsed incorrectly
  • The SwiftFormat SPM plugin now formats local dependencies, not just final product targets

0.52.8

17 Oct 11:17
Compare
Choose a tag to compare
  • Fixed redundantClosure rule in cases where an if/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

06 Oct 19:05
Compare
Choose a tag to compare
  • Fixed bug where conditionalAssignment and redundantClosure rules would be applied incorrectly
  • Fixed redundantClosure rule leaving stray try or await keywords behind

0.52.6

01 Oct 06:55
Compare
Choose a tag to compare
  • Fixed bug where redundantReturn rule was incorrectly applied to consecutive if statements in Swift 5.9

0.52.5

30 Sep 09:45
Compare
Choose a tag to compare
  • 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 with Note: 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