Skip to content

Releases: nicklockwood/SwiftFormat

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

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