Skip to content

Regression with Layout/MultilineMethodCallIndentation in 1.84.1 #14847

@rickselby

Description

@rickselby

Rubocop is reporting an error with previously passing code.


Steps to reproduce the problem

          rows.each_with_index.with_object([]) do |(row, row_index), galaxies|
            (0...row.length).select { row[it] == "#" }
                            .each { galaxies << [row_index, it] }
          end

Expected behavior

No offenses to be raised.

Actual behavior

test.rb:43:29: C: [Correctable] Layout/MultilineMethodCallIndentation: Use 2 (not 16) spaces for indenting an expression spanning multiple lines.
                            .each { galaxies << [row_index, it] }
                            ^^^^^

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:

1.84.1 (using Parser 3.3.10.1, Prism 1.9.0, rubocop-ast 1.49.0, analyzing as Ruby 4.0, running on ruby 4.0.0) +server [x86_64-linux]
  - rubocop-performance 1.26.1
  - rubocop-rake 0.7.1
  - rubocop-rspec 3.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions