Skip to content

Releases: nicklockwood/SwiftFormat

0.51.4

01 Apr 16:43
Compare
Choose a tag to compare
  • Limited redundantReturn inside if / switch expressions to Swift 5.9+
  • Fixed hoistTry and hoistAwait inside multiline string literals
  • Fixed invalid indenting of blank lines inside multiline string literals

0.51.3

27 Mar 20:14
Compare
Choose a tag to compare
  • Fixed hoistTry and hoistAwait rule breaking string interpolations
  • Fixed bug where opaqueGenericParameters rule would remove non-redundant generic type
  • Fixed parsing bug with trailing closures on optional methods
  • Fixed redundantSelf rule parsing bug affecting string literals
  • Updated if / switch expression features to be enabled only in Swift 5.9+

0.51.2

07 Mar 21:50
Compare
Choose a tag to compare
  • Fixed hoistTry rule breaking multiline function chains
  • Added --asynccapturing and --throwcapturing options for hoistTry and hoistAwait rules
  • Fixed changes in last line of file not being correctly tracked

0.51.1

02 Mar 08:04
Compare
Choose a tag to compare
  • Fixed redundantNilInit removing required nil inside Result Builders
  • Fixed redundantLet removing required let inside Result Builder switch/case statements
  • Fixed hoistTry rule removing second try inside XCTAssert statements

0.51.0

28 Feb 22:48
Compare
Choose a tag to compare
  • Added hoistAwait and hoistTry rules to hoist inline await/try to start of expression
  • Extended redundantPattern rule to remove redundant let in patterns
  • The wrapMultilineStatementBraces rules is now applied more consistently
  • Updated redundantReturn/Closure rules to support if/switch expressions in Swift 5.8
  • Added conditionalAssignment rule to assign variables using if/switch expressions in Swift 5.8
  • Updated redundantType rule to support if/switch expression assignment Swift 5.8
  • Extended redundantSelf rule to support implicit self in eligible closures in Swift 5.8
  • SwiftFormat now ignores .swiftformat files when explicit --config file is provided
  • Added --wrapenumcases with-values option to only wrap enum cases with values
  • Added --wrapeffects option for wrapping function effects
  • Removed unsafe preferDouble rule

0.50.9

16 Feb 23:16
Compare
Choose a tag to compare
  • Added Github actions log reporter (see --reporter option for details)
  • Fixed bug where redundantType sometimes stripped in cases where it couldn't be inferred
  • The redundantType rule now supports removing type in more cases where supported
  • Made SwiftFormat for Xcode instructions dynamic according to OS version
  • Fixed bug where a trailing comma could be left behind by opaqueGenericParameters rule
  • Fixed bug where wrapAttributes rule sometimes wrapped inline attributes like @MainActor
  • Improved support for // swiftformat:options comment directives
  • Removed deprecated options from the example .swiftformat file

0.50.8

29 Jan 14:47
Compare
Choose a tag to compare
  • The redundantBackticks rule no longer removes required comments around self
  • Associated type headerdoc comments are now handles correctly by the docComments rule
  • Fixed mangled comments when using the sortedSwitchCases rule
  • Hex, octal or binary literals are now sorted correctly in sortedSwitchCases rule
  • Fixed regression in closed brace indentation (introduced in 0.50.7)
  • Fixed unsafe semicolon removal after inferred var properties
  • Added fileHeader placeholder documentation

0.50.7

27 Dec 16:18
Compare
Choose a tag to compare
  • Fixed parsing of regex literals preceded by try or await
  • Fixed required parens being removed around await keyword
  • Fixed indent for nested, wrapped parameters

0.50.6

03 Dec 22:09
Compare
Choose a tag to compare
  • Fixed regression in fileHeader rule where blank lines were removed after header
  • Fixed globs matching when command-line tool is invoked from a directory such as /var/tmp
  • Fixed bug in parsing regex literals beginning with ^ character

0.50.5

29 Nov 18:49
Compare
Choose a tag to compare
  • Fixed incorrect macOS command line binary that accidentally shipped with 0.50.4