Skip to content

Commit b183a6a

Browse files
committed
fix
1 parent 60f5ab9 commit b183a6a

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

Source/SwiftLintBuiltInRules/Rules/Lint/MultilineCallArgumentsRule.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ struct MultilineCallArgumentsRule: Rule {
3636
Keeping each argument on its own line in multi-line calls improves readability and \
3737
reduces merge conflicts. Requiring a newline after commas makes the call's structure \
3838
immediately visible and avoids ambiguous layouts where arguments appear to share a line.
39-
39+
4040
## Configuration
41-
41+
4242
- `allows_single_line`: Allow calls with multiple arguments on a single line \
4343
(default: `true`)
4444
- `max_number_of_single_line_parameters`: Max arguments allowed on a single line \
4545
(default: `nil` — unlimited)
4646
- `indentation`: Indentation width for corrected lines \
4747
(integer for spaces, e.g. `4`, `2`, `8`; or the string `"tab"`); \
4848
`0` and negative values are invalid and will cause a configuration error
49-
49+
5050
## Behavior details
51-
51+
5252
- When `allows_single_line: false`, any call with 2+ arguments on one line triggers \
5353
a violation
5454
- Setting `allows_single_line: false` with `max_number_of_single_line_parameters > 1` \
@@ -57,9 +57,9 @@ struct MultilineCallArgumentsRule: Rule {
5757
- `max_number_of_single_line_parameters` only affects single-line calls; \
5858
in multi-line calls each argument must always start on its own line
5959
- Both labeled and unlabeled (positional) arguments are subject to the same rules
60-
60+
6161
## Auto-correction
62-
62+
6363
- Single-line calls are reformatted to place each argument on its own line with proper \
6464
indentation; the closing parenthesis moves to its own line at the call's base indent
6565
- Indentation is calculated relative to the call's start line; exactly one level of \
@@ -73,9 +73,9 @@ struct MultilineCallArgumentsRule: Rule {
7373
- Auto-correction does not reformat the internal content of arguments (e.g., closures, \
7474
array literals); the closing delimiter of such expressions may end up on its own line \
7575
after the split, requiring a subsequent manual adjustment
76-
76+
7777
## Skipped cases
78-
78+
7979
- When an argument's expression ends with `}` or `]` (e.g., a closure or array literal), \
8080
the comma-newline check is skipped — the argument is considered properly terminated
8181
- Pattern-matching positions (`if case let`, `switch case`, `for case let`, `catch`) \

Tests/BuiltInRulesTests/MultilineCallArgumentsRuleTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ extension MultilineCallArgumentsRuleTests {
242242
XCTAssertThrowsError(try MultilineCallArgumentsRule(
243243
configuration: ["max_number_of_single_line_parameters": -1]))
244244
XCTAssertThrowsError(try MultilineCallArgumentsRule(configuration: [
245-
"allows_single_line": false, "max_number_of_single_line_parameters": 2]))
245+
"allows_single_line": false,
246+
"max_number_of_single_line_parameters": 2
247+
]))
246248
}
247249
func testConfiguration_indentationTab_isValid() throws {
248250
let rule = try MultilineCallArgumentsRule(configuration: ["indentation": "tab"])

0 commit comments

Comments
 (0)