-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jkolarik-no_async_without_await
- Loading branch information
Showing
12 changed files
with
123 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Tests/SwiftLintFrameworkTests/MultilineParametersConfigurationTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@testable import SwiftLintBuiltInRules | ||
@testable import SwiftLintCore | ||
import XCTest | ||
|
||
final class MultilineParametersConfigurationTests: SwiftLintTestCase { | ||
func testInvalidMaxNumberOfSingleLineParameters() throws { | ||
for maxNumberOfSingleLineParameters in [0, -1] { | ||
var config = MultilineParametersConfiguration() | ||
|
||
XCTAssertEqual( | ||
try Issue.captureConsole { | ||
try config.apply( | ||
configuration: ["max_number_of_single_line_parameters": maxNumberOfSingleLineParameters] | ||
) | ||
}, | ||
""" | ||
warning: Inconsistent configuration for 'multiline_parameters' rule: Option \ | ||
'max_number_of_single_line_parameters' should be >= 1. | ||
""" | ||
) | ||
} | ||
} | ||
|
||
func testInvalidMaxNumberOfSingleLineParametersWithSingleLineEnabled() throws { | ||
var config = MultilineParametersConfiguration() | ||
|
||
XCTAssertEqual( | ||
try Issue.captureConsole { | ||
try config.apply( | ||
configuration: ["max_number_of_single_line_parameters": 2, "allows_single_line": false] | ||
) | ||
}, | ||
""" | ||
warning: Inconsistent configuration for 'multiline_parameters' rule: Option \ | ||
'max_number_of_single_line_parameters' has no effect when 'allows_single_line' is false. | ||
""" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters