From 257cfccd19c859639b1d5ee40e81d198fa096f4e Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz <82896394+mike-at-home@users.noreply.github.com> Date: Mon, 5 May 2025 13:10:26 -0500 Subject: [PATCH 1/7] Update README.md --- README.md | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 229bca9..41a59e3 100644 --- a/README.md +++ b/README.md @@ -160,17 +160,16 @@ _You can enable the following settings in Xcode by running [this script](resourc public func executeRequest( _ request: URLRequest, onSuccess: @escaping (ModelType, Bool) -> Void, - onFailure: @escaping (Error) -> Void) - -> URLSessionCancellable - { + onFailure: @escaping (Error) -> Void + ) -> URLSessionCancellable { return _executeRequest(request, onSuccess, onFailure) } private let _executeRequest: ( URLRequest, @escaping (ModelType, Bool) -> Void, - @escaping (Error) -> Void) - -> URLSessionCancellable + @escaping (Error) -> Void + ) -> URLSessionCancellable } ``` @@ -2041,7 +2040,7 @@ _You can enable the following settings in Xcode by running [this script](resourc -* (link) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label, and before the return signature or any effects (`async`, `throws`).** Put the open curly brace on the next line so the first executable line doesn't look like it's another parameter. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#wrapArguments) [![SwiftFormat: braces](https://img.shields.io/badge/SwiftFormat-braces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#braces) +* (link) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label, and before the closing parenthesis (`)`). [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#wrapArguments) [![SwiftFormat: braces](https://img.shields.io/badge/SwiftFormat-braces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/main/Rules.md#braces)
@@ -2097,9 +2096,8 @@ _You can enable the following settings in Xcode by running [this script](resourc at location: Point, count: Int, color: StarColor, - withAverageDistance averageDistance: Float) - -> String - { + withAverageDistance averageDistance: Float + ) -> String { populateUniverse() } @@ -2108,9 +2106,8 @@ _You can enable the following settings in Xcode by running [this script](resourc at location: Point, count: Int, color: StarColor, - withAverageDistance averageDistance: Float) - async throws -> String - { + withAverageDistance averageDistance: Float + ) async throws -> String { populateUniverse() } } @@ -3427,9 +3424,10 @@ _You can enable the following settings in Xcode by running [this script](resourc // WRONG func spaceshipDashboard( warpDrive: WarpDriveView, - captainsLog: CaptainsLogView) - -> some View - { … } + captainsLog: CaptainsLogView + ) -> some View { + … + } func generate(_ planets: Planets) where Planets: Collection, Planets.Element == Planet { … @@ -3438,9 +3436,10 @@ _You can enable the following settings in Xcode by running [this script](resourc // RIGHT func spaceshipDashboard( warpDrive: some View, - captainsLog: some View) - -> some View - { … } + captainsLog: some View + ) -> some View { + … + } func generate(_ planets: some Collection) { … @@ -3453,7 +3452,7 @@ _You can enable the following settings in Xcode by running [this script](resourc } // Also fine, since the generic parameter name is referenced in the function body so can't be removed: - func terraform(_ planetaryBody: Body) { + func terraform(_ planetaryBody: Body) { planetaryBody.generateAtmosphere(Body.idealAtmosphere) } ``` @@ -3466,8 +3465,8 @@ _You can enable the following settings in Xcode by running [this script](resourc func assertFailure( _ result: Result, file: StaticString = #filePath, - line: UInt = #line) - { + line: UInt = #line + ) { if case .failure(let error) = result { XCTFail(error.localizedDescription, file: file, line: line) } @@ -3477,8 +3476,8 @@ _You can enable the following settings in Xcode by running [this script](resourc func assertFailure( _ result: Result, file: StaticString = #filePath, - line: UInt = #line) - { + line: UInt = #line + ) { if case .failure(let error) = result { XCTFail(error.localizedDescription, file: file, line: line) } From 70ed19e0bd2c5075cec24ed8645f4ca2b923c6ec Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz <82896394+mike-at-home@users.noreply.github.com> Date: Mon, 5 May 2025 13:14:03 -0500 Subject: [PATCH 2/7] Update airbnb.swiftformat --- Sources/AirbnbSwiftFormatTool/airbnb.swiftformat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index 7e97426..15f7cbb 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -15,9 +15,9 @@ --wrapparameters before-first # wrapArguments --wrapcollections before-first # wrapArguments --wrapconditions before-first # wrapArguments ---wrapreturntype if-multiline #wrapArguments ---wrapeffects if-multiline #wrapArguments ---closingparen same-line # wrapArguments +--wrapreturntype never #wrapArguments +--wrapeffects never #wrapArguments +--closingparen balanced # wrapArguments --wraptypealiases before-first # wrapArguments --funcattributes prev-line # wrapAttributes --computedvarattrs prev-line # wrapAttributes From f5a8581b7458e6e52e74c33d0524935f224103f1 Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz <82896394+mike-at-home@users.noreply.github.com> Date: Mon, 5 May 2025 15:20:21 -0500 Subject: [PATCH 3/7] Update airbnb.swiftformat --- Sources/AirbnbSwiftFormatTool/airbnb.swiftformat | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index 15f7cbb..275bba0 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -18,6 +18,7 @@ --wrapreturntype never #wrapArguments --wrapeffects never #wrapArguments --closingparen balanced # wrapArguments +--callsiteparens same-line # wrapArguments --wraptypealiases before-first # wrapArguments --funcattributes prev-line # wrapAttributes --computedvarattrs prev-line # wrapAttributes From e465902cd142770e8ec5832782c92068e2b891aa Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz <82896394+mike-at-home@users.noreply.github.com> Date: Mon, 5 May 2025 15:21:16 -0500 Subject: [PATCH 4/7] Update airbnb.swiftformat --- Sources/AirbnbSwiftFormatTool/airbnb.swiftformat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index 275bba0..358fc46 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -18,7 +18,7 @@ --wrapreturntype never #wrapArguments --wrapeffects never #wrapArguments --closingparen balanced # wrapArguments ---callsiteparens same-line # wrapArguments +--callsiteparen same-line # wrapArguments --wraptypealiases before-first # wrapArguments --funcattributes prev-line # wrapAttributes --computedvarattrs prev-line # wrapAttributes From bebc13322b07ab69856ec63197c4f1ccb40f0089 Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz Date: Fri, 16 May 2025 10:44:06 -0500 Subject: [PATCH 5/7] Create .ruby-version --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..be94e6f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.2 From d3a3c94f0f44589aa45f226e38bf52805a48da12 Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz Date: Fri, 16 May 2025 10:44:30 -0500 Subject: [PATCH 6/7] Update Package.swift --- Package.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index 5624131..dd1f8ef 100644 --- a/Package.swift +++ b/Package.swift @@ -42,8 +42,8 @@ let package = Package( .binaryTarget( name: "swiftformat", - url: "https://github.com/calda/SwiftFormat-nightly/releases/download/2025-05-08-b/SwiftFormat.artifactbundle.zip", - checksum: "ce079f8a7c8d8ba2f9d6aa461367808b2d56b99739b0791946ed23059da88017"), + url: "https://github.com/calda/SwiftFormat-nightly/releases/download/2025-05-15-b/SwiftFormat.artifactbundle.zip", + checksum: "0d6f365f00de0567c5a7a0caf33b593c2a9029cf27462c63879280839f5f2d9c"), .binaryTarget( name: "SwiftLintBinary", From 53c5d64f91420bffe7ffe701f51bfc2227da70fa Mon Sep 17 00:00:00 2001 From: Mike Kasianowicz Date: Fri, 16 May 2025 10:44:32 -0500 Subject: [PATCH 7/7] Update Plugin.swift --- Plugins/FormatSwift/Plugin.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugins/FormatSwift/Plugin.swift b/Plugins/FormatSwift/Plugin.swift index 9d03c41..463471b 100644 --- a/Plugins/FormatSwift/Plugin.swift +++ b/Plugins/FormatSwift/Plugin.swift @@ -16,9 +16,8 @@ struct AirbnbSwiftFormatPlugin { func performCommand( context: CommandContext, inputPaths: [String], - arguments: [String]) - throws - { + arguments: [String] + ) throws { var argumentExtractor = ArgumentExtractor(arguments) // Filter out any excluded paths passed in with `--exclude`