KEMBAR78
Style/FirstParameterIndentation gets confused by non-trivial indentation · Issue #4308 · rubocop/rubocop · GitHub
Skip to content

Style/FirstParameterIndentation gets confused by non-trivial indentation #4308

@rwz

Description

@rwz
# code.rb

MyClass.my_method(a_hash.merge(
  hello: :world,
  some: :hash,
  goes: :here
), other_arg)

Expected behavior

In this case the first parameter to MyClass.my_method would the the result of a_hash.merge(...) method call and it should not be indented since it starts on the same line. The arguments to a_hash.merge though are indented relative to the line the method was called on, so it should also be ok.

Actual behavior

code.rb:2:3: C: Style/FirstParameterIndentation: Indent the first parameter one step more than a_hash.merge(.
  hello: :world, ...
  ^^^^^^^^^^^^^^

RuboCop version

$ rubocop -V
0.48.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions