chore(deps): update dependency apple/swift-format to v509 #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
from: "508.0.1"
->from: "509.0.0"
Release Notes
apple/swift-format (apple/swift-format)
v509.0.0
Compare Source
This release is compatible with Swift 5.9.
Significant changes since the last release:
New rules
AlwaysUseLiteralForEmptyCollectionInit
: transforms no-argument initializer calls on collection types to use the empty collection literal instead. For example,let x = [Int]()
will be transformed intolet x: [Int] = []
. This rule is opt-in (disabled by default).NoPlaygroundLiterals
: emits lint findings when the playground literals (#colorLiteral
,#fileLiteral
,#imageLiteral
) are used in code. Enabled by default.OmitExplicitReturns
: removes unnecessaryreturn
keywords from single-expression function/closure/subscript/accessor bodies. This rule is opt-in (disabled by default).ReplaceForEachWithForLoop
: emits lint findings when theforEach
method is called with a closure literal at the end of a member access chain, indicating that it should be replaced by afor
loop instead. Enabled by default.TypeNamesShouldBeCapitalized
: emits lint findings when a type is declared with a name that is notUpperCamelCase
. Enabled by default.New configuration settings
multiElementCollectionTrailingCommas
(boolean): When set tofalse
, the last element of a multi-element array or dictionary literal will not have a trailing comma, even when the literal wraps across multiple lines. Defaults totrue
(preserving the behavior of previous releases).Bug fixes and behavior changes
case
block that contains no statements.in
keyword and the first statement.import
statements are no longer wrapped.NoParensAroundConditions
rule no longer removes parentheses around an immediately called closure.NoAssignmentInExpressions
rule can be configured to ignore assignments that occur inside certain function calls. The default configuration ignores assignments insideXCTAssertNoThrow
.#if
expressions are no longer indented too far when they follow a closing parenthesis.BeginDocumentationCommentWithOneLineSummary
,UseTripleSlashForDocumentationComments
, andValidateDocumentationComments
.UseShorthandTypeNames
rule properly parenthesizes optionalsome/any
types; for example,Optional<any P>
becomes(any P)?
, notany P?
(which is invalid).UseSynthesizedInitializer
rule no longer warns that an initializer is redundant if it is declared with any attributes.--target
argument is not specified.API changes
For developers using swift-format as a library, the types in the
SwiftFormatConfiguration
module have been folded into theSwiftFormat
module. TheSwiftFormat
module is now the sole module you should import to use the linter/formatter APIs.The
SwiftFormatConfiguration
module still exists to re-export the types for backwards compatibility, but this will be removed in the 510.0.0 release.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.