Skip to content

Commit 57f52b6

Browse files
committed
Make unneeded_parentheses_in_closure_argument opt-in
1 parent 2eb73a9 commit 57f52b6

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.swiftlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ opt_in_rules:
2323
- fatal_error_message
2424
- vertical_parameter_alignment_on_call
2525
- let_var_whitespace
26+
- unneeded_parentheses_in_closure_argument
2627

2728
file_header:
2829
required_pattern: |

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
[Marcelo Fabri](https://github.com/marcelofabri)
6060
[#1647](https://github.com/realm/SwiftLint/issues/1647)
6161

62-
* Add `unneeded_parentheses_in_closure_argument` correctable rule that warns
63-
against using parentheses around argument declarations in closures.
62+
* Add `unneeded_parentheses_in_closure_argument` opt-in correctable rule that
63+
warns against using parentheses around argument declarations in closures.
6464
[Marcelo Fabri](https://github.com/marcelofabri)
6565
[#1483](https://github.com/realm/SwiftLint/issues/1483)
6666

Rules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12141,7 +12141,7 @@ protocol Foo {
1214112141

1214212142
Identifier | Enabled by default | Supports autocorrection | Kind
1214312143
--- | --- | --- | ---
12144-
`unneeded_parentheses_in_closure_argument` | Enabled | Yes | style
12144+
`unneeded_parentheses_in_closure_argument` | Disabled | Yes | style
1214512145

1214612146
Parentheses are not needed when declaring closure arguments.
1214712147

Source/SwiftLintFramework/Rules/UnneededParenthesesInClosureArgumentRule.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import Foundation
1111
import SourceKittenFramework
1212

13-
public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule {
13+
public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule, OptInRule {
1414
public var configuration = SeverityConfiguration(.warning)
1515

1616
public init() {}

0 commit comments

Comments
 (0)