-
Notifications
You must be signed in to change notification settings - Fork 101
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
Unable to disable the Layout/CaseIndentation
RuboCop linter.
#407
Comments
Because of how the new Rubocop system works, some cops are forced in some specific configuration. This is needed because the way the system works, haml-lint basically converts the HAML to valid ruby, runs rubocop, and then transfers the fixes. Some cops do transformation that ruin the expected structure of the code. CaseIndentation is one such example. I'm curious, are the errors you mention in regular haml (with - and =) or in a :ruby filter? You can see all of the forced rubocop configurations, as well as explanations, here: |
@MaxLap the problem is that we have nested - case sorting.direction
- when 'asc'
= icon('caret-up', aria: { label: 'ascending order' }, role: 'img')
- when 'desc'
= icon('caret-down', aria: { label: 'descending order' }, role: 'img') I'm going to try unindenting the blocks, but I'm a little concerned about ambiguity with following blocks: - case something
- when 'foo'
- when 'bar'
- unless something_else # this looks like it's part of the `case` even though it's completely separate. |
I understand your concern. The effect is less pronounced when you have content in your
The main reason we need to use the non-indented configuration is that HAML fails on this:
For some reason, it inserts an extra |
For some reason after upgrading to version 0.46.0, we're unable to disable the
Layout/CaseIndentation
lint. We get a lot of reports, but when I add it to the our custom RuboCop overrides, it won't disable it. That appears to be the only rule that won't disable, though. Others work as intended.The text was updated successfully, but these errors were encountered: