-
-
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 incorrect Style/HashSyntax autocorrection for assignment methods
In Ruby 3.1 and above, code like: ```ruby object.attr = {foo: foo} ^^^ Omit the hash value. pass ``` was incorrectly autocorrected to: ```ruby object.attr({foo:}) pass ``` The autocorrected code is valid Ruby, but is semantically different. This may and will lead to subtle bugs in user codebases.
- Loading branch information
1 parent
1f7094d
commit 693796e
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_incorrect_style_hash_syntax_autocorrection_for.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 @@ | ||
* [#11673](https://github.com/rubocop/rubocop/pull/11673): Fix incorrect `Style/HashSyntax` autocorrection for assignment methods. ([@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