Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect Style/HashSyntax autocorrection for assignment methods #11673

Merged
merged 1 commit into from
Mar 7, 2023

Commits on Mar 7, 2023

  1. 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.
    gsamokovarov committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    693796e View commit details
    Browse the repository at this point in the history