-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix value omission false positive in Style/MethodCallWithArgsParentheses
Omitting the parentheses in cases like the example below is ambigious, we don't need to enforce their omission in the `EnforcedStyle: omit_parentheses` ```ruby var = unless object.action(value:, other:) condition || other_condition end ``` If the parentheses in the condition above are omitted, the semantic of the code is changed: ```ruby var = unless object.action value:, other: condition || other_condition end # is interpreted as: var = unless object.action value:, other: condition || other_condition # empty branch end ``` We should allow parentheses in value omissions in conditional nodes.
- Loading branch information
1 parent
43209b3
commit 07b18b5
Showing
3 changed files
with
13 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#11709](https://github.com/rubocop/rubocop/pull/11709): Fix value omission false positive in `Style/MethodCallWithArgsParentheses`. ([@gsamokovarov][]) |
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