Skip to content

Releases: nicklockwood/SwiftFormat

0.58.7

29 Nov 12:29

Choose a tag to compare

  • Fixed redundantSelf not being applied inside if #available(...) { ... } clauses
  • Fixed fileHeader rule incorrectly setting creation year to current when file path contains spaces
  • Fixed mis-insertion for nil-init rule related to optional closure return values
  • Fixed unusedPrivateDeclarations false positive when call site was outside enabled range
  • Fixed sortImports rule incorrectly moving // swift-tools-version: comment directive
  • Fixed hoistTry rule sometimes producing mangled code when hoisting across line boundaries
  • Fixed crash in --ruleinfo command when rule options exceed the old max length requirement
  • Fixed crash in unusedArguments due to scope range bug

0.58.6

11 Nov 21:43

Choose a tag to compare

  • Fixed docComments not being applied correctly after conditional switch...case
  • Trailing commas are no longer inserted inside #selector(...) expressions
  • Source files listed with --filelist are now formatted concurrently
  • Trailing comments are now kept with the same line when wrapping
  • Fixed spurious return removal inside repeat...while loops
  • Fixed bug with trailingClosures rule and property wrappers
  • Fixed performance regression introduced in 0.58.5
  • Reduced timeout threshold to 1ms per token

0.58.5

17 Oct 20:17

Choose a tag to compare

  • Fixed regression with indenting of macros (introduced in 0.58.4)
  • Fixed spurious removal of return keyword inside for ... where loops
  • Fixed parsing error with for await case ... loops
  • Added XCTUnwrap to the default exclusion list for hoistTry

0.58.4

16 Oct 06:42

Choose a tag to compare

  • Whitespace is no longer added or removed from blank lines in multiline string literals
  • Fixed trailingComma rule incorrectly inserting commas inside typed throws
  • Fixed issue where opaqueGenericParameters rule could cause build errors with existential types
  • Fixed false positive with unusedArguments when argument is only referenced inside a macro
  • The noGuardInTests rule now preserves custom failure messages
  • The noGuardInTests rule no longer adds throws to test methods when not needed
  • Removed redundant "default" values from options help descriptions

0.58.3

04 Oct 13:38

Choose a tag to compare

  • Fixed parsing of [n of X] syntax for InlineArray in Swift 6.2
  • Fixed parsing error when an opening multiline string delimiter is followed by a space
  • Fixed issue where redundantInit rule could leave orphaned parentheses
  • Fixed bug where redundantInit was incorrectly applied to (Foo.self as Bar.Type) expressions
  • Fixed bug with parsing empty property accessors that broke redundantSelf rule
  • Fixed aliasing issue with acronyms rule where one acronym overlaps another
  • Fixed unexpected wrapping of closing parenthesis in wrapArguments rule
  • Added --unknown-rules option to support environments with older SwiftFormat versions

0.58.2

29 Sep 15:39

Choose a tag to compare

  • Fixed issue where modifierOrder rule confused async effect for async modifier
  • Fixed issue where testing related rules incorrectly treated functions with arguments as test cases
  • Updated redundantInit rule to apply to init calls with single trailing closure
  • Updated README.md to reflect actual precedence behavior between .swift-version files and --swift-version arguments

0.58.1

24 Sep 15:44

Choose a tag to compare

  • Fixed issue where async effect could be confused for async modifier, breaking docCommentsBeforeModifiers rule in protocol body with async functions
  • Fixed issue where wrapAttributes rule would unexpectedly wrap async effect
  • Fixed issue where .swift-version file was ignored if not also using config file
  • Fixed issue where multiple trailing closure syntax could be applied to ineligible function calls
  • Fixed issue where redundantAsync ignored await keyword in string interpolation
  • Fixed bug where acronyms rule would incorrectly always capitalize potentially matching acronyms one letter before end of identifier
  • Updated redundantLet rule to handle #Preview macro

0.58.0

23 Sep 02:17

Choose a tag to compare

  • Added noForceUnwrapInTests rule
  • Added redundantThrows rule
  • Added redundantAsync rule
  • Added preferFinalClasses rule
  • Added support for Swift 6.2 raw identifiers
  • Updated trailingCommas rule to handle cases now supported by Swift 6.2
  • Updated trailingClosures rule to support multiple trailing closures
  • Added support for filtering config file options to a specific file path glob
  • Added --allow-partial-wrapping false option to disallow partial wrapping of functions and collections
  • Updated propertyTypes rule to support array, dictionary, and set literals
  • Added organizeDeclarations threshold options to organize types without adding marks
  • Added --type-body-marks remove option to organizeDeclarations
  • Updated organizeDeclarations to support organizing protocol bodies
  • Added --blank-line-after-switch-case always option to blankLineAfterSwitchCase
  • Added --default-test-suite-attributes option to preferSwiftTesting rule
  • Renamed --markdown-files options to strict and lenient
  • Updated redundantPublic rule to apply to private types
  • Updated trailingClosures and trailingCommas rules to support optional function calls
  • Fixed bug where markTypes rule wouldn't add marks after extensions
  • Fixed issue where redundantPublic broke @_spi annotated members
  • Improved parsing of nested markdown code blocks
  • Fixed issue where hoistTry rule could break @Test attribute
  • Fixed issue where redundantVoidReturnType rule could accidentally remove closure type
  • Fix blankLinesAroundMark not ignoring trailing comments at start of scope
  • Renamed throwingTests rule to noForceTryInTests
  • Updated singlePropertyPerLine to preserve async let declarations

0.57.2

15 Jul 01:34

Choose a tag to compare

  • Updated trailingCommas rule to handle function declarations with generic arguments.
  • Updated --trailing-commas always to preserve trailing commas rather than unnecessarily removing trailing commas in some edge cases.
  • Fixed spurious deprecation message when using some non-deprecated options.

0.57.1

14 Jul 13:47

Choose a tag to compare

  • Fixed issue where trailing commas were unexpectedly removed from initializer argument lists when using --trailing-commas always.
  • Fixed issue where redundantPublic rule didn't handle extensions on types defined in public extensions.
  • Added @Bindable to list of SwiftUI property wrappers used by organizeDeclarations rule.
  • Fixed case-sensitivity issue with preferFileMacro rule.