Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Documentation/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -221,7 +221,7 @@ a hard line break
will be formatted as:
```swift
"""
an esacpe\
an escape\
line break
a hard \
line break
Expand Down
2 changes: 1 addition & 1 deletion Documentation/RuleDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftFormat/API/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -211,7 +211,7 @@ public struct Configuration: Codable, Equatable {
/// will be formatted as:
/// ```swift
/// """
/// an esacpe\
/// an escape\
/// line break
/// a hard \
/// line break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down