Releases: swiftlang/swift-format
Releases · swiftlang/swift-format
Swift 5.10 Release
What's Changed
- Update to non-optional leading/trailingTrivia swift-syntax API by @bnbarham in #497
- Adjustments to split
FunctionParameterSyntaxinto 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-coredependency 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->memberBlockby @ahoppen in #512 - [SwiftSyntax] Remove force unwrapping for source location by @kimdv in #513
- Change version dependency on
swift-argument-parserto fromupToNextMinortoupToNextMajorby @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/awaitexpressions inNoAssignmentInExpressions. by @allevato in #533 - Further improve multiline string formatting. by @allevato in #534
- Allow exceptions to
NoAssignmentInExpressions. by @allevato in #535 - Add
Token.breakafter fixity in operator declaration by @StevenWong12 in #536 - Rename
elementListinTupleExprSyntaxtoelementsby @StevenWong12 in #537 - Fix
async throwsfunction 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
macrodeclarations. 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
@backDeployattribute. by @allevato in #550 - Don't insert an extra break inside empty multiline strings. by @allevato in #551
- Downgrade
editor placeholder in source filefrom error to warning. by @allevato in #547 - Improve wrapping of if/switch expressions. by @allevato in #553
- Fix postfix-
#ifformatting 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].IndexwithArray<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
initializerfromTupleTypeElementSyntaxinitializer 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
whereinstead of filter forforloops by @ahoppen in #575 - Adjustments for usage of
DeclReferenceExprSyntaxas child ofMemberAccessExprSyntaxby @ahoppen in #577 - [Core] Add new finding severity kinds -
refactoringandconventionby @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
ReplaceTriviarewriter with direct trivia mutations. by @allevato in #588 - Parenthesize
some/anytypes when convertingOptionalto?. by @allevato in #589 - Update for the fact that syntax collections are always non-optional in SwiftSyntax now by @ahoppen in #585
- Make
shebanga child ofSourceFileSyntaxby @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
SwiftFormatmodule. 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
returnfrom functions, closures, subscripts, and variables by @xedin in #596 - [Lint] Add a rule to replace
.forEachwith a for-in loop by @xedin in #603 - Replace
withcalls with in-place mutation; clean up helpers. by @allevato in #609 - Actually implement
NoPlaygroundLiteralsrule. by @allevato in #613 - Adjust for "remark" diagnostic severity by @DougGregor in #605
- Move
Configurationinto theSwiftFormatmodule. by @allevato in #614 - Fix invalid links in README by @woxtu in #594
- Default to all targets when plugin
--targetparameter missing. Fix #483 by @BrianHenryIE in #608 - Remove unnecessary casting by @Matejkob in #618
- Output a warning for unknown configuration rules in
.swift-formatby @natikgadzhi in #612 - Generate rule docs automatically by @natikgadzhi in #615
New Contributors
- @stackotter made their first contribution in #501
- @CippoX made their first contribution in #510
- @StevenWong12 made their first contribution in #536
- @kimberninger made their first contribution in ht...
508.0.1
508.0.0
This release is compatible with Swift 5.8.
Significant changes since the last release:
- The
spacesAroundRangeFormationOperatorsconfiguration 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 whereXCTestis imported conditionally in a#ifblock. - Primary associated type clauses in
protocoldeclarations 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 shorthandT?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
This is a development snapshot of the 0.50800.0 release of swift-format.
0.50700.1
0.50700.0
This release is compatible with Swift 5.7.
Significant changes since the last release:
- The
AlwaysUseLowerCamelCaserule no longer emits a warning foroverridedeclarations. (0e705f4) - The
UseWhereClausesInForLoopsrule won't hoist anifcondition into awhereclause if it also has anelseblock. (793d764) #ifpostfix 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
0.50600.0
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
SwiftFormatterandSwiftLinterclasses) now receive warnings and errors via a newFindingtype that is independent ofSwiftSyntaxdiagnostic 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-diagnosticscommand 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
throwsandasyncproperty effects has been fixed. (f646a1f, 55fc4e2) - The legacy
-m/--modeflag has been removed. (defb00d)
0.50500.0
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
--parallelformat mode. (6d500ea) generate-pipelineno 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):UseEarlyExitsandUseWhereClausesInForLoops. These rules are not currently stable or well-tested so they are disabled by default. (6bd3a55)
0.50400.0
This release is compatible with Swift 5.4.
Significant changes since the last release:
- The
--parallelflag supports formatting multiple files in parallel. This should be much faster when formatting large numbers of files. (a062ec8) - The
--ignore-unparsable-filesflag is now honored inlintmode; unparsable files are silently ignored and no diagnostic is emitted. (fc3fab6) #ifdeclarations surroundingcaseclauses inside aswitchstatement are formatted correctly. (8df2cb0)UseLetInEveryBoundCaseVariableno longer produces incorrect diagnostics for certain patterns. (c3c17ad)BeginDocumentationCommentWithOneLineSummaryhas been made opt-in by default. (22118db)UseSynthesizedInitializernow produces more accurate diagnostics by considering the visibility of the stored properties in the type. (dd87cc2)