From cc2f07ae891bc152a981e84ecec0083fd4099c04 Mon Sep 17 00:00:00 2001 From: Alexander Sandberg Date: Tue, 18 Feb 2025 13:10:52 +0100 Subject: [PATCH 1/5] Fix typos in Configuration.md --- Documentation/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Configuration.md b/Documentation/Configuration.md index f84fb1c60..14745d62e 100644 --- a/Documentation/Configuration.md +++ b/Documentation/Configuration.md @@ -113,7 +113,7 @@ top-level keys and values: ### `prioritizeKeepingFunctionOutputTogether` **type:** boolean -**description:** Determines if function-like declaration outputs should be prioritized to be together with thefunction signature right (closing) parenthesis. If `false`, function output (i.e. throws, return type) is not prioritized to be together with the signature's right parenthesis, and when the line length would be exceeded,a line break will be fired after the function signature first, indenting the declaration output one additional level. If true, A line break will be fired further up in the function's declaration (e.g. generic parameters, parameters) before breaking on the function's output. +**description:** Determines if function-like declaration outputs should be prioritized to be together with the function signature's right (closing) parenthesis. If `false`, function output (i.e. throws, return type) is not prioritized to be together with the signature's right parenthesis, and when the line length would be exceeded, a line break will be fired after the function signature first, indenting the declaration output one additional level. If true, a line break will be fired further up in the function's declaration (e.g. generic parameters, parameters) before breaking on the function's output. **default:** `false` From 14ba745a1b33afd76237509f77eeb65be3ddd9f7 Mon Sep 17 00:00:00 2001 From: Alexander Sandberg Date: Tue, 18 Feb 2025 13:15:47 +0100 Subject: [PATCH 2/5] Fix some more typos in Configuration.md --- Documentation/Configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/Configuration.md b/Documentation/Configuration.md index 14745d62e..8decd52e6 100644 --- a/Documentation/Configuration.md +++ b/Documentation/Configuration.md @@ -186,7 +186,7 @@ switch someValue { ### `noAssignmentInExpressions` **type:** object -**description:** Assignment expressions must be their own statements. Assignment should not be used in an expression context that expects a `Void` value. For example, assigning a variable within a `return` statement existing a `Void` function is prohibited. +**description:** Assignment expressions must be their own statements. Assignment should not be used in an expression context that expects a `Void` value. For example, assigning a variable within a `return` statement exiting a `Void` function is prohibited. - `allowedFunctions` _(strings array)_: A list of function names where assignments are allowed to be embedded in expressions that are passed as parameters to that function. @@ -221,7 +221,7 @@ a hard line break will be formatted as: ```swift """ -an esacpe\ +an escape\ line break a hard \ line break From c9131f48814a18c172c39ce4efa7afbc0987517c Mon Sep 17 00:00:00 2001 From: Alexander Sandberg Date: Tue, 18 Feb 2025 14:27:45 +0100 Subject: [PATCH 3/5] Update Configuration.swift --- Sources/SwiftFormat/API/Configuration.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftFormat/API/Configuration.swift b/Sources/SwiftFormat/API/Configuration.swift index 70ac916aa..dd574580f 100644 --- a/Sources/SwiftFormat/API/Configuration.swift +++ b/Sources/SwiftFormat/API/Configuration.swift @@ -122,12 +122,12 @@ public struct Configuration: Codable, Equatable { public var lineBreakBetweenDeclarationAttributes: Bool /// Determines if function-like declaration outputs should be prioritized to be together with the - /// function signature right (closing) parenthesis. + /// function signature's right (closing) parenthesis. /// /// If false (the default), function output (i.e. throws, return type) is not prioritized to be /// together with the signature's right parenthesis, and when the line length would be exceeded, /// a line break will be fired after the function signature first, indenting the declaration output - /// one additional level. If true, A line break will be fired further up in the function's + /// one additional level. If true, a line break will be fired further up in the function's /// declaration (e.g. generic parameters, parameters) before breaking on the function's output. public var prioritizeKeepingFunctionOutputTogether: Bool @@ -211,7 +211,7 @@ public struct Configuration: Codable, Equatable { /// will be formatted as: /// ```swift /// """ - /// an esacpe\ + /// an escape\ /// line break /// a hard \ /// line break From 054505a52b2183c518dee671155040e0f76763ad Mon Sep 17 00:00:00 2001 From: Alexander Sandberg Date: Tue, 18 Feb 2025 14:28:56 +0100 Subject: [PATCH 4/5] Update RuleDocumentation.md --- Documentation/RuleDocumentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RuleDocumentation.md b/Documentation/RuleDocumentation.md index f0d7e6b2a..2d0b416cd 100644 --- a/Documentation/RuleDocumentation.md +++ b/Documentation/RuleDocumentation.md @@ -243,7 +243,7 @@ Format: The access level is removed from the extension declaration and is added Assignment expressions must be their own statements. Assignment should not be used in an expression context that expects a `Void` value. For example, -assigning a variable within a `return` statement existing a `Void` function is prohibited. +assigning a variable within a `return` statement exiting a `Void` function is prohibited. Lint: If an assignment expression is found in a position other than a standalone statement, a lint finding is emitted. From 8ddedcf91241ab8e30a82219dd7b7c614e166178 Mon Sep 17 00:00:00 2001 From: Alexander Sandberg Date: Tue, 18 Feb 2025 14:29:25 +0100 Subject: [PATCH 5/5] Update NoAssignmentInExpressions.swift --- Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift b/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift index 62db9130d..bc10f3a31 100644 --- a/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift +++ b/Sources/SwiftFormat/Rules/NoAssignmentInExpressions.swift @@ -15,7 +15,7 @@ import SwiftSyntax /// Assignment expressions must be their own statements. /// /// Assignment should not be used in an expression context that expects a `Void` value. For example, -/// assigning a variable within a `return` statement existing a `Void` function is prohibited. +/// assigning a variable within a `return` statement exiting a `Void` function is prohibited. /// /// Lint: If an assignment expression is found in a position other than a standalone statement, a /// lint finding is emitted.