Ask questionsFalse positive for Layout/ArgumentAlignment

The following code is in a .js.haml file in my Rails application and somehow, it's triggering an offense for the cop Layout/ArgumentAlignment:

I kept the exact same indentation as in my file. This is what RuboCop outputs:

Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.

After trying out various indentation changes, I just don't get it. Someone has a clue?

RuboCop version

1.16.1 (using Parser, rubocop-ast 1.7.0, running on ruby 2.5.8 x86_64-linux-gnu)
  - rubocop-performance 1.10.2
  - rubocop-rails 2.10.1
  - rubocop-rspec 2.2.0

RuboCop is called from haml-lint, this is why it's linting a .js.haml file.


Answer questions koic

Layout/ArgumentAlignment cop now supports first keyword arguments and HAML-Lint will need to support it.

I'm not familiar with HAML-Lint, but at least it's passed to RuboCop with the following alignment, so this is not a false positive.

openSUSE/open-build-service code

$('.in-place-editing').html("#{escape_javascript(render(partial: 'webui/package/basic_info',
                                                        locals: { package: @package, project: @project }))}");

The result of some processing of haml-lint

render(partial: 'webui/package/basic_info',
                                                            locals: { package: @package, project: @project })

Can you open the issue to HAML-Lint?

Thank you.

Koichi ITO koic ESM, Inc. (@esminc) Tokyo, Japan @rubocop core team.
Github User Rank List