Skip to content

Releases: swiftlang/swift-format

Swift 5.10 Release

06 Mar 16:12
f14a625
Compare
Choose a tag to compare

What's Changed

  • Update to non-optional leading/trailingTrivia swift-syntax API by @bnbarham in #497
  • Adjustments to split FunctionParameterSyntax into multiple nodes for function parameters, closure parameters and enum parameters by @ahoppen in #495
  • Prepare 508.0.0 release. by @allevato in #506
  • Fix formatting of import with multiple attributes (fixes #445) and ensure that imports never wrap by @stackotter in #501
  • Fix fatal error caused by switch cases without any statements (#473) by @stackotter in #499
  • Remove the swift-tools-support-core dependency from swift-format. by @allevato in #509
  • Fix pretty printing of multi-statement closures (issue #494) by @stackotter in #498
  • Avoid removing certain disambiguating parens from conditions (fixes #298) by @stackotter in #503
  • Fix more postfix pound if scenarios by @DavidBrunow in #402
  • Remove usages of functions that shouldn’t be part of SwiftSyntax’s public API by @ahoppen in #504
  • Removed warnings by @CippoX in #510
  • Adjustment for SwiftSyntax rename members -> memberBlock by @ahoppen in #512
  • [SwiftSyntax] Remove force unwrapping for source location by @kimdv in #513
  • Change version dependency on swift-argument-parser to from upToNextMinor to upToNextMajor by @ahoppen in #517
  • Replace deprecated code of swift-syntax with the latest code to remove warning by @TTOzzi in #531
  • Fix indentation of multiline strings when part of a larger expression. by @allevato in #532
  • Fix try/await expressions in NoAssignmentInExpressions. by @allevato in #533
  • Further improve multiline string formatting. by @allevato in #534
  • Allow exceptions to NoAssignmentInExpressions. by @allevato in #535
  • Add Token.break after fixity in operator declaration by @StevenWong12 in #536
  • Rename elementList in TupleExprSyntax to elements by @StevenWong12 in #537
  • Fix async throws function types when they appear in an expression context. by @allevato in #539
  • Replace deprecated code from swift-syntax by @TTOzzi in #540
  • Wrap keypath literals appropriately. by @allevato in #545
  • Format macro declarations. by @allevato in #546
  • Insert white space before trailing closure of a macro expression by @kimberninger in #544
  • Rename 'squareBracket' to 'square' by @TTOzzi in #541
  • Delete UnknownNodeTests. by @allevato in #548
  • Fix formatting of @backDeploy attribute. by @allevato in #550
  • Don't insert an extra break inside empty multiline strings. by @allevato in #551
  • Downgrade editor placeholder in source file from error to warning. by @allevato in #547
  • Improve wrapping of if/switch expressions. by @allevato in #553
  • Fix postfix-#if formatting when they come after a closing parenthesis. by @allevato in #554
  • Fix indentation of multiline strings in enum case raw values. by @allevato in #555
  • Fix deprecated SwiftSyntax api warnings by @kitasuke in #558
  • Remove the compiler condition guarding DerivativeRegistrationAttributeArgumentsSyntax. by @allevato in #559
  • Use swift-markdown to parse documentation comments. by @allevato in #560
  • Adjustment because of a property rename in swift-syntax by @ahoppen in #561
  • Replace [TriviaPiece].Index with Array<TriviaPiece>.Index. by @allevato in #565
  • Remove --mode flag for configuration dump by @Gray-Wind in #566
  • Use newer equivalents of deprecated nodes names by @Matejkob in #567
  • Add XCTest exclusion comment for lint rules by @kitasuke in #568
  • Use methods on Sequence instead of SyntaxCollection by @kitasuke in #569
  • Update swift-format for renamed children in SwiftSyntax by @ahoppen in #562
  • Fix deprecated warnings regarding swift-syntax changes by @kitasuke in #570
  • Adjustments for node renames in swift-syntax by @ahoppen in #572
  • Remove initializer from TupleTypeElementSyntax initializer call by @ahoppen in #573
  • Rename children of differentiability nodes by @ahoppen in #574
  • Adjustments for refactoring of representation of Accessors in SwiftSyntax by @ahoppen in #576
  • Use where instead of filter for for loops by @ahoppen in #575
  • Adjustments for usage of DeclReferenceExprSyntax as child of MemberAccessExprSyntax by @ahoppen in #577
  • [Core] Add new finding severity kinds - refactoring and convention by @xedin in #578
  • Fix deprecation warnings from renamed nodes / types in SwiftSyntax by @ahoppen in #579
  • Move the default Configuration.init() into a separate file. by @allevato in #580
  • Don't alter doc line comments unnecessarily. by @allevato in #581
  • Improve a bunch of diagnostic messages. by @allevato in #583
  • Migrate away from the latest deprecated APIs. by @allevato in #584
  • Replace the ReplaceTrivia rewriter with direct trivia mutations. by @allevato in #588
  • Parenthesize some/any types when converting Optional to ?. by @allevato in #589
  • Update for the fact that syntax collections are always non-optional in SwiftSyntax now by @ahoppen in #585
  • Make shebang a child of SourceFileSyntax by @StevenWong12 in #590
  • [Lint] Add a rule to detect that type declarations are not capitalized by @xedin in #587
  • Don't warn about a redundant synthesized memberwise init if it has attributes. by @allevato in #592
  • Collapse almost everything into a single SwiftFormat module. by @allevato in #593
  • Refactor tests. by @allevato in #595
  • Don't do anything if the input is empty. by @allevato in #599
  • Fix a bunch of FIXMEs around linter findings. by @allevato in #597
  • [Lint/Format] Add a rule to omit return from functions, closures, subscripts, and variables by @xedin in #596
  • [Lint] Add a rule to replace .forEach with a for-in loop by @xedin in #603
  • Replace with calls with in-place mutation; clean up helpers. by @allevato in #609
  • Actually implement NoPlaygroundLiterals rule. by @allevato in #613
  • Adjust for "remark" diagnostic severity by @DougGregor in #605
  • Move Configuration into the SwiftFormat module. by @allevato in #614
  • Fix invalid links in README by @woxtu in #594
  • Default to all targets when plugin --target parameter missing. Fix #483 by @BrianHenryIE in #608
  • Remove unnecessary casting by @Matejkob in #618
  • Output a warning for unknown configuration rules in .swift-format by @natikgadzhi in #612
  • Generate rule docs automatically by @natikgadzhi in #615

New Contributors

Read more

508.0.1

17 May 20:11
fbfe186
Compare
Choose a tag to compare

This release is compatible with Swift 5.8.

Compared to 508.0.0, this release relaxes the version requirement for swift-argument-parser, resulting in fewer version conflicts for users of swift-format and SwiftSyntax.

508.0.0

07 Apr 18:14
3330aaa
Compare
Choose a tag to compare

This release is compatible with Swift 5.8.

Significant changes since the last release:

  • The spacesAroundRangeFormationOperators configuration option has been added to force a space around range formation operators like ... and ..<.
  • A new rule, NoAssignmentInExpressions, has been added that emits a linter finding if an assignment expression is found in another expression context (for example, return x = y).
  • Format and Lint plug-ins have been added that can be used from Swift Package Manager and Xcode.
  • Detection of "files that contain XCTests" has been improved to include cases where XCTest is imported conditionally in a #if block.
  • Primary associated type clauses in protocol declarations are formatted correctly.
  • When a closure literal contains both a leading attribute and a capture list (e.g., { @MainActor [weak self] in ...), a space is guaranteed between the attribute and capture list.
  • Optional<T> will not be automatically converted to the shorthand T? in positions where it would cause a performance issue due to subtle Swift initialization characteristics, like in member variable declarations.

0.50800.0-SNAPSHOT-2022-12-29-a

05 Jan 21:25
Compare
Choose a tag to compare
Pre-release

This is a development snapshot of the 0.50800.0 release of swift-format.

0.50700.1

10 Oct 15:24
5f18422
Compare
Choose a tag to compare

This release is compatible with Swift 5.7.

This update pins the swift-syntax dependency to at least 0.50700.1, which fixes an issue where new if let shorthand syntax was not recognized.

0.50700.0

20 Sep 16:12
3dd9b51
Compare
Choose a tag to compare

This release is compatible with Swift 5.7.

Significant changes since the last release:

  • The AlwaysUseLowerCamelCase rule no longer emits a warning for override declarations. (0e705f4)
  • The UseWhereClausesInForLoops rule won't hoist an if condition into a where clause if it also has an else block. (793d764)
  • #if postfix expressions now have improved formatting. (7216a18)
  • Files will not be overwritten if they are not changed during formatting, preserving their modification time and other metadata. (3b2b9b4)

0.50600.1

22 Mar 19:47
e6b8c60
Compare
Choose a tag to compare

This release is compatible with Swift 5.6.

This update fixes a build error caused by a conflicting Windows-only conformance from swift-tools-support-core and one that we added in our code base. (22f1843)

0.50600.0

18 Mar 20:11
c062580
Compare
Choose a tag to compare

This release is compatible with Swift 5.6.

Significant changes since the last release:

  • Diagnostics have been refactored as "findings". Users of swift-format as an API (via the SwiftFormatter and SwiftLinter classes) now receive warnings and errors via a new Finding type that is independent of SwiftSyntax diagnostic types, for greater flexibility. (7aa5df5)
  • Diagnostics are now printed in color if standard error is connected to a terminal. This can be controlled with the --color-diagnostics/--no-color-diagnostics command line flags (to force color output when redirected to something other than a terminal, or to disable color output to a terminal). (4f90887)
  • Formatting of throws and async property effects has been fixed. (f646a1f, 55fc4e2)
  • The legacy -m/--mode flag has been removed. (defb00d)

0.50500.0

21 Sep 23:59
f872223
Compare
Choose a tag to compare

This release is compatible with Swift 5.5.

Significant changes since the last release:

  • New concurrency syntax added in Swift 5.5 is supported. (427d314)
  • Closures with attributes in their function signature are supported. (35e8687)
  • Significant stability and performance improvements have been made to --parallel format mode. (6d500ea)
  • generate-pipeline no longer uses a hardcoded list of suppressed rules, instead marking those rules as opt-in. This makes two "new" rules available (they have always had implementations but have been suppressed): UseEarlyExits and UseWhereClausesInForLoops. These rules are not currently stable or well-tested so they are disabled by default. (6bd3a55)

0.50400.0

28 Apr 22:49
9c15831
Compare
Choose a tag to compare

This release is compatible with Swift 5.4.

Significant changes since the last release:

  • The --parallel flag supports formatting multiple files in parallel. This should be much faster when formatting large numbers of files. (a062ec8)
  • The --ignore-unparsable-files flag is now honored in lint mode; unparsable files are silently ignored and no diagnostic is emitted. (fc3fab6)
  • #if declarations surrounding case clauses inside a switch statement are formatted correctly. (8df2cb0)
  • UseLetInEveryBoundCaseVariable no longer produces incorrect diagnostics for certain patterns. (c3c17ad)
  • BeginDocumentationCommentWithOneLineSummary has been made opt-in by default. (22118db)
  • UseSynthesizedInitializer now produces more accurate diagnostics by considering the visibility of the stored properties in the type. (dd87cc2)