-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
Style/HashSyntax
aware of without parentheses call expr follows
Prepare to solve #11182. This commit makes `Style/HashSyntax` aware of without parentheses call expr follows. It prepares to prevent `Style/HashSyntax` with `Style/IfUnlessModifier` autocorrection conflicts that resolve #11182. ## Before Previously `Style/HashSyntax` accepted the following syntax to prevent syntax errors: ```ruby foo bar value: value baz ``` This avoids the following incompatible syntax: ```ruby foo bar value: baz ``` ## After `Style/HashSyntax` registers an offense for: ```ruby foo bar value: value baz ``` And the autocorrection adds parentheses to prevent syntax errors shown in the URL: https://bugs.ruby-lang.org/issues/18396 ```ruby foo bar(value:) baz ```
- Loading branch information
Showing
4 changed files
with
114 additions
and
27 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
1 change: 1 addition & 0 deletions
1
...change_make_style_hash_syntax_aware_of_without_parentheses_call_expr_follows.md
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 @@ | ||
* [#11185](https://github.com/rubocop/rubocop/pull/11185): Make `Style/HashSyntax` aware of without parentheses call expr follows. ([@koic][]) |
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