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

False positive for Layout/ArgumentAlignment #9864

Closed
dmarcoux opened this issue Jun 9, 2021 · 1 comment
Closed

False positive for Layout/ArgumentAlignment #9864

dmarcoux opened this issue Jun 9, 2021 · 1 comment

Comments

@dmarcoux
Copy link

dmarcoux commented Jun 9, 2021

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:

https://github.com/openSUSE/open-build-service/blob/94660dfcced5541ece9ed3c964c779896ad051b6/src/api/app/views/webui/interconnects/create.js.haml#L5

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 3.0.1.1, 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.

@koic
Copy link
Member

koic commented Jun 16, 2021

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

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?
https://github.com/sds/haml-lint

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants