-
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
How to un-ignore the ignored rubocop cops? #77
Comments
Hey @maxjacobson, Those cops are ignored for a good reason: Can you give a specific example of a cop you want to disable? If you still REALLY want to do this, you just need to redefine the entire list in your local linters:
RuboCop:
ignored_cops: [] # NOT RECOMMENDED! |
Hey @sds thanks for getting back to me! there are a few nitpicky things I was hoping haml-lint would catch:
are you saying it doesn't analyze the file as it is, but first transforms it into some other ruby file, so it wouldn't catch those things necessarily anyway? thanks! |
Yes, as part of its preprocessing, - if signed_in?(viewer)
%span Stuff
= link_to 'Sign Out', sign_out_path
- else
.some-class{ class: my_method }= my_method
= link_to 'Sign In', sign_in_path ...into Ruby like this: if signed_in?(viewer)
link_to 'Sign Out', sign_out_path
else
{ class: my_method }
my_method
link_to 'Sign In', sign_in_path
end Notice that the Ruby is somewhat nonsensical. All For things like indentation, it may be possible to munge things into shape but I haven't looked too deeply into that. Right now if you have HAML like the following: %tag{ some: 'hash',
attributes: 'here' } ...it will get extracted as: { some: 'hash', attributes: 'here' } ...losing some of the whitespace in the process. This makes it difficult to have it generate correct indentation. For your request about final newlines, I think it's reasonable for |
Makes total sense, thanks for explaining. Adding a newline check would be super helpful! What do you think about checking for the presence of a tab character? I think most Rubyists are using spaces, not tabs, so checking for the presence of a tab |
Awesome! Thanks a lot @sds |
haml-lint ignores some rubocop cops (https://github.com/brigade/haml-lint/blob/master/config/default.yml#L56-L70)
Let's say I didn't want it to...
I tried figuring out how to configure haml-lint to enable those cops but couldn't quite figure it out. Is it possible?
Thanks!
The text was updated successfully, but these errors were encountered: