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

Suppresses Rubocop warnings to get accurate version #1512

Closed
wants to merge 1 commit into from
Closed

Suppresses Rubocop warnings to get accurate version #1512

wants to merge 1 commit into from

Conversation

buccolo
Copy link

@buccolo buccolo commented Aug 10, 2015

Hello,

First of all, thank you so much for this awesome tool! 🍻

I've noticed my Rubocop install outputs this warning:

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

Which messes up the getVersion function.

Because there's no flag in Rubocop to hide such warnings, I've ignored them like it's done in coffee.vim

Please let me know if there's anything else I can/should do.

Thanks!

@lcd047
Copy link
Collaborator

lcd047 commented Aug 10, 2015

There's always the radical approach of reading the docs. :) In this case, the relevant wiki page.

@buccolo
Copy link
Author

buccolo commented Aug 10, 2015

Hmmm thanks @lcd047 I missed that 👍

I think this PR is still valid, because we suppress rubocop warnings only to get the current version.

I shouldn't wrap my rubocop in a script that silences all warnings, because the wiki page mentions there are useful warnings:

Most issues returned by rubocop are warnings, so for best results your g:syntastic_quiet_messages should not filter out warnings.

Additionally, some folks (including me) can't update Ruby to the latest version as fast as we would like (external requirements, etc..). So we shouldn't use rbenv (or similar tools) to use the latest version of Ruby, as the wiki suggests, because it would break our dev/prod parity a little bit.

What do you think?

@lcd047
Copy link
Collaborator

lcd047 commented Aug 10, 2015

I think this PR is still valid, because we suppress rubocop warnings only to get the current version.

No it isn't. It also ignores warnings unrelated to Ruby version.

I shouldn't wrap my rubocop in a script that silences all warnings,

The wrapper I suggest doesn't ignore all warnings.

because the wiki page mentions there are useful warnings:

You're mixing warnings about the abnormal functioning of rubocop with warnings about the contents of the file being checked. The former are fatal as far as syntastic is concerned. The latter are normal output.

Additionally, some folks (including me) can't update Ruby to the latest version as fast as we would like (external requirements, etc..). So we shouldn't use rbenv (or similar tools) to use the latest version of Ruby

If you have several versions of Ruby installed, you can use rbenv or rvm to switch between them without making a mess. This is orthogonal to whether the versions you are using are old or new.

What do you think?

I think you should take your time to make sense of all this.

@lcd047 lcd047 closed this Aug 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants