From 57f52b6a6b9ac808bebda5e1a15c5c49d01c92f7 Mon Sep 17 00:00:00 2001 From: Marcelo Fabri Date: Wed, 19 Jul 2017 15:34:51 +0200 Subject: [PATCH] Make unneeded_parentheses_in_closure_argument opt-in --- .swiftlint.yml | 1 + CHANGELOG.md | 4 ++-- Rules.md | 2 +- .../Rules/UnneededParenthesesInClosureArgumentRule.swift | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 1811620d1b..e850db17f1 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -23,6 +23,7 @@ opt_in_rules: - fatal_error_message - vertical_parameter_alignment_on_call - let_var_whitespace + - unneeded_parentheses_in_closure_argument file_header: required_pattern: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 954e2b0d05..89f122d368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,8 +59,8 @@ [Marcelo Fabri](https://github.com/marcelofabri) [#1647](https://github.com/realm/SwiftLint/issues/1647) -* Add `unneeded_parentheses_in_closure_argument` correctable rule that warns - against using parentheses around argument declarations in closures. +* Add `unneeded_parentheses_in_closure_argument` opt-in correctable rule that + warns against using parentheses around argument declarations in closures. [Marcelo Fabri](https://github.com/marcelofabri) [#1483](https://github.com/realm/SwiftLint/issues/1483) diff --git a/Rules.md b/Rules.md index 3c5b657b70..7b2d59a997 100644 --- a/Rules.md +++ b/Rules.md @@ -12141,7 +12141,7 @@ protocol Foo { Identifier | Enabled by default | Supports autocorrection | Kind --- | --- | --- | --- -`unneeded_parentheses_in_closure_argument` | Enabled | Yes | style +`unneeded_parentheses_in_closure_argument` | Disabled | Yes | style Parentheses are not needed when declaring closure arguments. diff --git a/Source/SwiftLintFramework/Rules/UnneededParenthesesInClosureArgumentRule.swift b/Source/SwiftLintFramework/Rules/UnneededParenthesesInClosureArgumentRule.swift index 67acdfc645..8c978a7506 100644 --- a/Source/SwiftLintFramework/Rules/UnneededParenthesesInClosureArgumentRule.swift +++ b/Source/SwiftLintFramework/Rules/UnneededParenthesesInClosureArgumentRule.swift @@ -10,7 +10,7 @@ import Foundation import Foundation import SourceKittenFramework -public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule { +public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule, OptInRule { public var configuration = SeverityConfiguration(.warning) public init() {}