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

:preserved HAML filter throws rubocop Style/ColonMethodCall warnings #74

Closed
johnathanludwig opened this issue Apr 11, 2015 · 2 comments
Closed
Labels

Comments

@johnathanludwig
Copy link

I have a few places where I use the preserve haml filter, and they get checked with rubocop and throw the ColonMethodCall warning.

screenshot 2015-04-10 20 08 24

@sds sds added the question label Apr 11, 2015
@sds
Copy link
Owner

sds commented Apr 11, 2015

Hey @johnathanludwig, thanks for the report.

The lint being reported here is not referring to the :preserve line, although I can understand the confusion. It's actually referring to some interpolation within the :preserve filter content itself, e.g.

:preserve
  #{Module::method}

You can fix the problem by writing:

:preserve
  #{Module.method}

Right now, all lints found in HAML filters are reported on the line of the filter's name. This obviously isn't ideal, but since we aren't heavy users of filters at Brigade we were comfortable with taking a shortcut here.

I've opened up #75 to track implementing a fix.

@sds sds closed this as completed Apr 11, 2015
@johnathanludwig
Copy link
Author

Well I feel dumb for not inspecting what was inside the preserve. I think a note in the readme regarding filters would be sufficient. I searched for information on them before posting, but couldn't find anything.

Thanks for the help, and great job on this linter!

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

No branches or pull requests

2 participants