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

Set minimum supported Ruby version via .rubocop.yml #2550

Closed
bbatsov opened this issue Dec 29, 2015 · 0 comments
Closed

Set minimum supported Ruby version via .rubocop.yml #2550

bbatsov opened this issue Dec 29, 2015 · 0 comments

Comments

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 29, 2015

This PR reminded me that we finally have to:

  • add a way to specify minimum supported version for a project via .rubocop.yml
  • add a generic config for cops like RequiredRubyVersion, which will act in tandem with the global setting

The net result is that we'll stop hardcoding Ruby versions inside cops and it will be much clearer from the config if some cop isn't supporting all Rubies RuboCop supports.

@bbatsov bbatsov changed the title Set minimum support Ruby version via .rubocop.yml Set minimum supported Ruby version via .rubocop.yml Dec 29, 2015
alexdowad added a commit to alexdowad/rubocop that referenced this issue Jan 1, 2016
This parameter can be used to configure which version of the Ruby interpreter
the inspected code is intended to run under. When checking syntax by running
the parser on a snippet of corrected code, RC will use the corresponding parser.
Also, RC will not encourage the use of a construct which is not available under
the target version. Auto-correction will also be careful not to emit code which
will not run on the target interpreter.

Previously, since the parser used was tied to the version of the underlying
Ruby interpreter, not all specs were run on all Ruby versions. Also, it was not
possible to run RC on a 1.9 interpreter to check a project using 2.2 syntax
(for example). Now, all specs run on all Ruby versions, and you can use any
supported interpreter to check any project.

Closes rubocop#2389, closes rubocop#2550.
@bbatsov bbatsov closed this as completed in 553d84a Jan 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant