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

Constrain (shipped) RuboCop's version #3754

Merged
merged 1 commit into from Jun 28, 2020

Conversation

utkarsh2102
Copy link
Contributor

Right now, we're not specifying the version constraints
on RuboCop that is shipped when a new gem is created.
This can break specs which runs rubocop on a new
skeleton gem as the newer versions of RuboCop are
released.

This commit ensures that the specs don't break by
constraining the RuboCop version.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>


Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

Right now, we're not specifying the version constraints
on RuboCop that is shipped when a new gem is created.
This can break specs which runs rubocop on a new
skeleton gem as the newer versions of RuboCop are
released.

This commit ensures that the specs don't break by
constraining the RuboCop version.

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
@deivid-rodriguez
Copy link
Member

@utkarsh2102 I'm not sure this constraint buys us much, since it allows anything under 1.0. I guess we can leave it as it is.

@utkarsh2102
Copy link
Contributor Author

Hm, since we're also using 0.80.1, I couldn't narrow down the version further.
But sure, if you want to leave it as is, I'm very okay with that, too :)

@deivid-rodriguez
Copy link
Member

I was thinking to either:

  • Leave it as it is.
  • Fully (or at least further) lock it with a conditional on the ruby version, like <%= Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.4.a") ? "~> 0.86.0" : "0.80.1" %>

Although on the other hand, rubocop has been recently much less agressive regarding breaking changes on 0.x releases, so the constraint you added is probably just fine, and maybe the best option.

Not really sure, we can revisit in a few days and wait for input from others.

@utkarsh2102
Copy link
Contributor Author

Sure, we can wait for a while. Maybe a week or so.
But from what I know, there'll be a 1.0.0 release very soon. That'd break something, I think. The minor and patch releases are very unlikely to break something.
But the second option you proposed looks good! 😄

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it some more thought, and I think your proposal is the best idea 👍

@bronzdoc bronzdoc merged commit 02f98a1 into rubygems:master Jun 28, 2020
@utkarsh2102 utkarsh2102 deleted the constrain-rubocop-version branch June 28, 2020 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants