Skip to content

Releases: nicklockwood/SwiftFormat

0.55.3

27 Nov 01:21
Compare
Choose a tag to compare
  • Fixed bug where sortTypealiases rule could mangle generic types, or ones using the any keyword
  • The preferKeyPaths rule now only uses \\.self for Swift 6 and later (fix din't land yet in 5.10)
  • Added speculative fix for plugin artifactbundle not working on ubuntu-latest

0.55.2

24 Nov 09:47
Compare
Choose a tag to compare
  • Fixed bug where unusedArguments failed to remove arguments that matched switch variable bindings
  • Fixed bug where unusedArguments failed to remove arguments that matched nested function call labels
  • Fixed spurious lint errors for blankLinesAtStartOfScope when using organizeDeclarations rule
  • Fixed bug where indentation errors were incorrectly reported as wrap rule lint errors
  • The preferKeyPaths rule now handles the \\.self case for Swift 5.10 and later
  • Fixed parsing of keyPaths beginning with \.?

0.55.1

20 Nov 23:41
Compare
Choose a tag to compare
  • Fixed bug where docCommentsBeforeModifiers got confused by enum cases that match modifier names
  • Fixed bug where wrapEnumCases would mangle nested or successive enum declarations
  • Artifact Bundle now includes pre-built binary for ARM-based Linux systems

0.55.0

16 Nov 23:08
Compare
Choose a tag to compare
  • Added docCommentsBeforeModifiers rule to hoist doc comments above declaration modifiers
  • Added unusedPrivateDeclarations rule to remove unused private or fileprivate declarations
  • Added propertyTypes rule to control the use of inferred or explicit types for properties
  • Renamed the --redundanttype option to --propertytypes as it's shared by both rules
  • Added --ranges preserve and --operatorfunc preserve options
  • Added --languagemode option to specify if you are using Swift 5 or 6 language mode
  • The organizeDeclarations rule can now sort declarations by name/type/visibility/etc
  • Fixed organizeDeclarations bug where --beforemarks unexpectedly matched keywords in function bodies
  • Fixed missing lint output for organizeDeclarations rule
  • Fixed bug in markTypes rule for chained protocol extension names
  • Renamed the confusing --onelineforeach option to --inlinedforeach
  • Git info can now be used in header comments when formatting code from stdin
  • You can now use the --outputtokens option to print output as tokens in JSON format
  • Each rule and test is now defined in a separate file to make it easier to maintain/contribute
  • Updated minimum Swift version for building SwiftFormat to 5.3 (you can still format older Swift code)
  • Docker build now uses static Linux SDK

0.54.6

08 Oct 17:43
Compare
Choose a tag to compare
  • Fixed incorrect wrapping of conditional bodies inside single-line string literals
  • Fixed properties inside type with where clause being treated as local scope
  • Fixed regression in wrapMultilineStatementBraces rule
  • Fixed tokenizing of a throwing closure type in a generics clause
  • Fixed bug in parseDeclarations where incorrect tokens could cause rules to time out
  • Fixed issue where organizeDeclarations would add extra blank lines if type had blank lines with spaces
  • Added known issue to README for preferForLoop rule

0.54.5

11 Sep 19:04
Compare
Choose a tag to compare
  • Fixed crash in unusedArguments rule
  • Fixed bug where preferForLoop failed if forEach contains guard ... else { return }

0.54.4

06 Sep 22:54
Compare
Choose a tag to compare
  • Fixed bug where trailing comma was erroneously inserted into a wrapped array type extension
  • Fixed bug where return was incorrectly removed inside catch statement with where clause
  • Fixed opaqueGenericParameters rule being incorrectly applied to functions with typed throws
  • Fixed spaceAroundBrackets behaving incorrectly inside a macro invocation
  • Fixed unusedArguments false positive inside multiline string literal
  • Fixed a case where removing return resulted in non-compiling code for opaque return types
  • Redundant Void return type is now removed from functions in protocol declarations
  • Fixed a bug where unusedArguments didn't handle conditional assignment shadowing correctly
  • Fixed Xcode 16 Beta warnings related to unhandled files when building SwiftFormat package
  • The Swift runtime is now packaged with the installer on Windows as on Linux
  • The Windows installer now uses a more conventional directory structure
  • SwiftFormat for Windows now supports arm64

0.54.3

28 Jul 16:00
Compare
Choose a tag to compare
  • Fixed issue where --wrapeffects never could unexpectedly remove unrelated code
  • Fixed --condassignment option (setting this previously had no effect)
  • The redundantReturn rule no longer removes conditional returns if conditionalAssignment is disabled
  • The redundantObjc rule now strips implicit @objc attribute for @IBSegueAction functions
  • Fixed bug where violations for rules that insert new lines were sometimes ignored in lint output

0.54.2

22 Jul 08:42
Compare
Choose a tag to compare
  • Fixed broken formatter cache, which caused a significant performance regression since 0.54.0
  • The blankLinesBetweenChainedFunctions rule now removes blank line after comments in the chain
  • The blankLinesBetweenChainedFunctions rule no longer conflicts with blankLinesAroundMark
  • FixedredundantInternal removing required internal keyword in extensions with where clause
  • Fixed another case of spurious return removal in conditional blocks
  • Fixed redundantNilInit rule inserting nil after as keyword

0.54.1

10 Jul 20:08
Compare
Choose a tag to compare
  • The --nilInit insert option is no longer applied to lazy or attributed properties
  • The blankLinesBetweenChainedFunctions rule now correctly handles comments in the chain
  • Fixed indenting of wrapped arguments in --fragment mode
  • Fixed bug where attributes were mistaken for an accessor in a computer property
  • Fixed indenting of commented code after an opening bracket
  • Fixed spurious removal of return in conditional blocks
  • Fixed --lint mode reporter output when using stdin