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

Stronger rubocop version pin prevents upgrading this gem for us #56

Closed
mak-dunkelziffer opened this issue Jan 20, 2025 · 5 comments
Closed

Comments

@mak-dunkelziffer
Copy link

rubocop 1.61 has problems with stringio for us, so we upgraded to rubocop 1.70.

makandra-rubocop 1.14.0 prints warnings to the console, so we wanted to upgrade to 1.14.1 which doesn't print the warnings.

However, it has a stricter version pin on rubocop in the gemspec. ~> 1.61.0 instead of ~> 1.61. This is incompatible with newer rubocops.

Why was this changed? Was there any known incompatibility? If possible, please use a less strict pin that doesn't prevent rubocop upgrades.

Our temporary fix is to use the old version of makandra-rubocop and ignore the console warnings.

Warning: Lint/UselessAssignment does not support SafeAutoCorrect parameter.

Supported parameters are:

  - Enabled
  - AutoCorrect

Warning: Lint/UselessAssignment does not support SafeAutoCorrect parameter.

Supported parameters are:

  - Enabled
  - AutoCorrect
@brunosedler
Copy link
Contributor

The less strict version pin was actually a non-desired behavior that was introduced by mistake.
There were only a few releases that had a less strict version pin, and #52 reverted to the prior behavior.

Do you have a reason to keep two apparently parallel used rubocops in your projects, or why do you have the necessity to upgrade rubocop independently from this gem?

@brunosedler
Copy link
Contributor

We recently released version 15.0.0 which increased the rubocop version to 1.70.0. Upgrading the makandra-rubocop should fix your issues.

@mak-dunkelziffer
Copy link
Author

The less strict version pin was actually a non-desired behavior that was introduced by mistake. There were only a few releases that had a less strict version pin, and #52 reverted to the prior behavior.

Do you have a reason to keep two apparently parallel used rubocops in your projects, or why do you have the necessity to upgrade rubocop independently from this gem?

This issue originated from the gemika test setup for one of our gems. To keep the setup simple and not split up Gemfiles, I tried to find a set of gem versions that was compatible with our whole test matrix.

Introducing support for Ruby 3.4 introduced the warnings for the old makandra-rubocop version. However, due to the version pin, I couldn't upgrade makandra-rubocop for old Ruby versions.

As this is an edge case, I can live with the current situation and you can consider this issue closed. However, I still don't understand the justification for the strict version pin.

@brunosedler
Copy link
Contributor

The purpose of this gem is to have a curated list of cops to save its users the time it takes to make decisions on newly introduced cops themselves and to keep styles consistent across the projects that use it. Pinning rubocop to the less strict ~>1.61 may give you the latest minor version of rubocop, as in your case it was 1.70. However, new cops have likely been introduced by the minor versions between 1.61.0 and 1.70.0. Those new cops are not curated by this gem, which in turn may lead to style deviations across projects and the necessity for its users to make decisions on cops themselves. Therefore, the less strict pin undermines the purpose of this gem.

@mak-dunkelziffer
Copy link
Author

Thanks for the explanation.

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

No branches or pull requests

2 participants