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

Read TargetRubyVersion from gemspec required_ruby_version if not specified #8761

Closed
donv opened this issue Sep 22, 2020 · 3 comments · Fixed by #8885
Closed

Read TargetRubyVersion from gemspec required_ruby_version if not specified #8761

donv opened this issue Sep 22, 2020 · 3 comments · Fixed by #8885
Labels
enhancement good first issue Easy task, suitable for newcomers to the project

Comments

@donv
Copy link

donv commented Sep 22, 2020

Is your feature request related to a problem? Please describe.

Gemspec/RequiredRubyVersion enforces that gemspec.required_ruby_version is set and then complains that it differs from TargetRubyVersion in .rubocop.yml even if it is not specified in .rubocop.yml.

Having to specify TargetRubyVersion in .rubocop.yml in addition to gemspec.required_ruby_version duplicates the information.

Describe the solution you'd like

If TargetRubyVersion is not specified in .rubocop.yml it should be read from gemspec.required_ruby_version if present.

@bbatsov
Copy link
Collaborator

bbatsov commented Sep 25, 2020

Fine by me.

@bbatsov bbatsov added enhancement good first issue Easy task, suitable for newcomers to the project labels Sep 25, 2020
@HeroProtagonist
Copy link
Contributor

👋 I am going to take a stab at this one

@HeroProtagonist
Copy link
Contributor

PR submitted 👍

HeroProtagonist added a commit to HeroProtagonist/rubocop that referenced this issue Nov 8, 2020
HeroProtagonist added a commit to HeroProtagonist/rubocop that referenced this issue Nov 8, 2020
HeroProtagonist added a commit to HeroProtagonist/rubocop that referenced this issue Nov 8, 2020
cetinajero added a commit to cetinajero/rubocop that referenced this issue Nov 12, 2020
This fixes an issue when the `required_ruby_version` uses `Gem::Requirement` to define the Ruby version.

e.g.

```
s.required_ruby_version = Gem::Requirement.new('< 3.0.0')
```

Related to rubocop#8761
bbatsov pushed a commit that referenced this issue Nov 13, 2020
This fixes an issue when the `required_ruby_version` uses `Gem::Requirement` to define the Ruby version.

e.g.

```
s.required_ruby_version = Gem::Requirement.new('< 3.0.0')
```

Related to #8761
ashkulz added a commit to prontolabs/pronto-rubocop that referenced this issue Feb 18, 2021
As a result of rubocop/rubocop#8761
the TargetRubyVersion is read from the gemspec and due to a bug
rubocop/rubocop#9482 this blocks
the upgrade to support later RuboCop versions -- so let's specify
2.4 as a workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants