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

Updated Gemspec/RequiredRubyVersion to handle blank values #10157

Merged
merged 1 commit into from Oct 20, 2021

Conversation

dvandersluis
Copy link
Member

Adds detection for empty versions and required_ruby_version being set more than once. Also did a minor refactor to use on_send instead of having all the logic in on_new_investigation.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@dvandersluis
Copy link
Member Author

I've updated this to just keep the added version checks (for '' and [], etc.) and removed the other logic. I've kept the refactoring to using on_send because I think that's preferable to doing everything in on_new_investigation

@dvandersluis dvandersluis changed the title Updated Gemspec/RequiredRubyVersion to detect more issues Updated Gemspec/RequiredRubyVersion to handle blank values Oct 6, 2021
@dvandersluis
Copy link
Member Author

@koic are you ok with merging this in its current form?

@bbatsov bbatsov merged commit a319d09 into rubocop:master Oct 20, 2021
@bbatsov
Copy link
Collaborator

bbatsov commented Oct 20, 2021

Looks good to me. Thanks!

nickpellant added a commit to nickpellant/rubocop that referenced this pull request Jan 11, 2022
Fixes a bug believed to be introduced by rubocop#10157 where the cop
no longer supported multiple requirements when they were passed as a
`Gem::Requirement` object instead of as an array.
bbatsov pushed a commit that referenced this pull request Jan 12, 2022
Fixes a bug believed to be introduced by #10157 where the cop
no longer supported multiple requirements when they were passed as a
`Gem::Requirement` object instead of as an array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants