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 an error for Layout/RedundantLineBreak #12656

Merged
merged 1 commit into from
Jan 28, 2024

Commits on Jan 27, 2024

  1. Fix an error for Layout/RedundantLineBreak

    This PR fixes the following error for `Layout/RedundantLineBreak` when using
    index access call chained on multiline hash literal:
    
    ```console
    $ cat example.rb
    {
      key: value
    }[key]
    
    $ bundle exec rubocop --only Layout/RedundantLineBreak -a -d
    (snip)
    
    An error occurred while Layout/RedundantLineBreak cop was inspecting /tmp/example.rb:1:0.
    undefined method `method?' for an instance of RuboCop::AST::HashNode
    /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/layout/redundant_line_break.rb:92:in `index_access_call_chained?'
    ```
    koic committed Jan 27, 2024
    Configuration menu
    Copy the full SHA
    a3a30d4 View commit details
    Browse the repository at this point in the history