Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Is there a way to ignore rubocop warnings? #1418

Closed
firedev opened this issue May 14, 2015 · 8 comments
Closed

Is there a way to ignore rubocop warnings? #1418

firedev opened this issue May 14, 2015 · 8 comments

Comments

@firedev
Copy link

firedev commented May 14, 2015

Depending on some factors rubocop is showing this line sometimes:

$ rubocop                                                                                                                                                                     
warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.6-compliant syntax, but you are running 2.1.2.

Since I am in a project with other developers and dependencies I can't do shit about it and it blows up Syntastic.

I was told to run it with ruby -W0 -S, okay, fair enough. How can I do that?

Or is there a better way?

@firedev
Copy link
Author

firedev commented May 14, 2015

In fact ruby-lint suffer from the same issue caused by parser:

$ ruby-lint                                                                                                                                                                 
warning: parser/current is loading parser/ruby21, which recognizes
warning: 2.1.6-compliant syntax, but you are running 2.1.2.
You must specify at least one file to analyze

@lcd047
Copy link
Collaborator

lcd047 commented May 14, 2015

Depending on some factors rubocop is showing this line sometimes:

Write a wrapper around rubocop and point g:syntastic_ruby_rubocop_exec to it.

Since I am in a project with other developers and dependencies I can't do shit about it and it blows up Syntastic.

And thus I'm supposed to fix it. How nice.

Or is there a better way?

Nope, we're arseholes all the way down.

In fact ruby-lint suffer from the same issue caused by parser:

Write another wrapper?

@firedev
Copy link
Author

firedev commented May 14, 2015

Sorry, not sure what ticked you off, I simply removed the warning from parser itself.

Thank you for pointing me to the wrapper thing, couldn't find a way how to do it.

@firedev firedev closed this as completed May 14, 2015
@lcd047
Copy link
Collaborator

lcd047 commented May 14, 2015

Sorry, not sure what ticked you off

Not ticked off at all, that was supposed to self irony. Syntastic maintainer blames rubocop. Rubocop maintainer blames parser. Parser maintainer blames ruby. And the funny thing is, each of us have reasons for doing it (aside from being arseholes, that is). :)

@lcd047
Copy link
Collaborator

lcd047 commented May 14, 2015

For what it's worth: I added a note to the wiki with the current workarounds.

@firedev
Copy link
Author

firedev commented May 14, 2015

Thank you, this definitely helps.

@firedev firedev reopened this May 14, 2015
@firedev firedev closed this as completed May 14, 2015
@gawbul
Copy link

gawbul commented Dec 4, 2015

Another way around this is to uninstall the current version of parser and install an older version that supports the syntax for your version of ruby? Look in https://github.com/whitequark/parser/blob/v2.2.3.0/lib/parser/current.rb, find your ruby version, then go back through the tags until you find the tag that supports your version of ruby? For example for ruby version 2.1.6, I had to install parser 2.2.2.6.

update: just noticed you said you are working with other developers, with a number of dependencies, so maybe this isn't an option?

@firedev
Copy link
Author

firedev commented Dec 7, 2015

I have just edited the local gem and commented the warnings out.

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

No branches or pull requests

3 participants