Skip to content

Commit 5f12304

Browse files
chore(deps): update dependency apple/swift-format to v509 (#21)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [apple/swift-format](https://togithub.com/apple/swift-format) | major | `from: "508.0.1"` -> `from: "509.0.0"` | --- ### Release Notes <details> <summary>apple/swift-format (apple/swift-format)</summary> ### [`v509.0.0`](https://togithub.com/apple/swift-format/releases/tag/509.0.0) [Compare Source](https://togithub.com/apple/swift-format/compare/508.0.1...509.0.0) 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 into `let 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 unnecessary `return` keywords from single-expression function/closure/subscript/accessor bodies. This rule is **opt-in** (disabled by default). - `ReplaceForEachWithForLoop`: emits lint findings when the `forEach` method is called with a closure literal at the end of a member access chain, indicating that it should be replaced by a `for` loop instead. Enabled by default. - `TypeNamesShouldBeCapitalized`: emits lint findings when a type is declared with a name that is not `UpperCamelCase`. Enabled by default. ##### New configuration settings - `multiElementCollectionTrailingCommas` (boolean): When set to `false`, 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 to `true` (preserving the behavior of previous releases). ##### Bug fixes and behavior changes - swift-format no longer crashes when formatting a `case` block that contains no statements. - In multi-statement closures, there is now always a line break between the `in` keyword and the first statement. - Attributes before `import` statements are no longer wrapped. - The `NoParensAroundConditions` rule no longer removes parentheses around an immediately called closure. - The `NoAssignmentInExpressions` rule can be configured to ignore assignments that occur inside certain function calls. The default configuration ignores assignments inside `XCTAssertNoThrow`. - When an editor placeholder is found in the source, this is now treated as a warning instead of an error. This allows formatting to continue, treating the placeholder as a regular identifier. - Keypath literals are properly wrapped and indented. - Postfix-`#if` expressions are no longer indented too far when they follow a closing parenthesis. - Indentation of multiline strings has been fixed in a number of locations. - Documentation comment parsing has improved for rules like `BeginDocumentationCommentWithOneLineSummary`, `UseTripleSlashForDocumentationComments`, and `ValidateDocumentationComments`. - Diagnostic messages throughout swift-format have been cleaned up and improved. - The `UseShorthandTypeNames` rule properly parenthesizes optional `some/any` types; for example, `Optional<any P>` becomes `(any P)?`, not `any P?` (which is invalid). - The `UseSynthesizedInitializer` rule no longer warns that an initializer is redundant if it is declared with any attributes. - The lint/format plugins for SPM now default to processing all targets if the `--target` argument is not specified. - swift-format now emits a warning if you configure a rule that does not exist. This is meant to help catch typos in the configuration file. - swift-format now does nothing if its input is empty (i.e., a zero-byte file). This suppresses a single trailing newline that would have otherwise been added in this case. ##### API changes For developers using swift-format as a library, the types in the `SwiftFormatConfiguration` module have been folded into the `SwiftFormat` module. The `SwiftFormat` 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. </details> --- ### 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/open-feature/swift-sdk). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent eb0cd56 commit 5f12304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tools/SwiftFormat/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let package = Package(
55
name: "SwiftFormat",
66
platforms: [.macOS(.v10_14)],
77
dependencies: [
8-
.package(url: "https://github.com/apple/swift-format", from: "508.0.1")
8+
.package(url: "https://github.com/apple/swift-format", from: "509.0.0")
99
],
1010
targets: [.target(name: "SwiftFormat", path: "")]
1111
)

0 commit comments

Comments
 (0)