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

Require RuboCop 0.89 or higher #86

Closed
wants to merge 1 commit into from

Conversation

koic
Copy link
Contributor

@koic koic commented Apr 29, 2021

Follow #73.

Lint/BinaryOperatorWithIdenticalOperands cop has introduced by RuboCop 0.89.0 and RuboCop GitHub uses the cop.
rubocop/rubocop@d94c4a4

This PR prevents the following error when using RuboCop 0.88 or lower.

% bundle exec rake
(snip)

Running RuboCop...
Error: unrecognized cop Lint/BinaryOperatorWithIdenticalOperands found
in config/_default_shared.yml
RuboCop failed!

Follow github#73.

`Lint/BinaryOperatorWithIdenticalOperands` cop has introduced by RuboCop 0.89.0
and RuboCop GitHub uses the cop.
rubocop/rubocop@d94c4a4

This PR prevents the following error when using RuboCop 0.88 or lower.

```console
% bundle exec rake
(snip)

Running RuboCop...
Error: unrecognized cop Lint/BinaryOperatorWithIdenticalOperands found
in config/_default_shared.yml
RuboCop failed!
```
koic added a commit to koic/rubocop-github that referenced this pull request Apr 29, 2021
Follow rubocop/rubocop#7868.

The legacy `Cop::Cop` API is soft deprecated and this PR use
new `Cop::Base` API instead.

> maintain any RuboCop extensions, as the legacy API will be removed in
> RuboCop 2.0.

https://metaredux.com/posts/2020/10/21/rubocop-1-0.html

This new API requires RuboCop 0.87 or higher.
https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md#0870-2020-07-06

Denpendency version of `s.add_dependency "rubocop"` does not need to be
updated in the gemspec if github#86 has been merged first.
@koic koic mentioned this pull request Apr 29, 2021
@composerinteralia
Copy link
Member

composerinteralia commented Jan 11, 2022

Thanks for the PR! The README for this project says:

The current version of this gem exposes the "legacy" configuration under config/default.yml and config/rails.yml which should be used if and only if the version of rubocop is locked to < 0.68 in your project

I don't think this comment quite makes sense after this PR, nor do the "legacy" configuration files.

Maintaining multiple versions of the config file doesn't seem to be working that well for us (as evidenced by the unrecognized cop error you mention here), so I think we could delete the "legacy" files and then update the README (maybe adding note about using rubocop-github < 0.16.2 for anyone relying on the < 0.68 config).

(No pressure for you to actually do this work. I'm just thinking out loud about what should probably be done to merge this.)

composerinteralia added a commit that referenced this pull request Jan 11, 2022
These constraints make it more difficult to upgrade these libraries in
projects that use rubocop-github.

I think the idea here was that we'd be able to bump the version
alongside the default config, but without locking to an exact version we
can still end up with a config that is incompatible with certain rubocop
version (see the unrecognized cop error in
#86, for example).

If anything, I'd prefer a `>=` constraint over a `<=`. That would allow
us to bump the minimum constraint when we add new cops, but still
freely upgrade in our projects as long as there are no config
incompatibilities (which are less common anyway ever since RuboCop 1.0).
composerinteralia added a commit that referenced this pull request Jun 24, 2022
Maintaining a separate "edge" config and "legacy" config probably served
us well back around the time we were migrating to rubocop 0.68, it's not
working well for us anymore. Things changed often before rubocop 1.0,
and there are versions out there that don't work perfectly with either
of these configs (see #86,
for example).

This commit sets a version constraint for rubocop ">= 1.0.0" and deletes
the `*_deprecated.yml` files that only worked with rubocop >
0.68. With the deprecated files deleted, it also consolidates the
remaining files into default.yml and rails.yml.
composerinteralia added a commit that referenced this pull request Jun 24, 2022
Maintaining a separate "edge" config and "legacy" config probably served
us well [back around the time we were migrating to rubocop
0.68](d533765),
but it's not working well for us anymore. Things changed often before
rubocop 1.0, and there are versions out there that don't work perfectly
with either of these configs (see
#86, for example).

This commit sets a version constraint for rubocop ">= 1.0.0" and deletes
the `*_deprecated.yml` files that only worked with rubocop <
0.68. With the deprecated files deleted, it also consolidates the
remaining files into default.yml and rails.yml.
composerinteralia added a commit that referenced this pull request Jun 24, 2022
Maintaining a separate "edge" config and "legacy" config probably served
us well [back around the time we were migrating to rubocop
0.68](d533765),
but it's not working well for us anymore. Things changed often before
rubocop 1.0, and there are versions out there that don't work perfectly
with either of these configs (see
#86, for example).

This commit sets a version constraint for rubocop ">= 1.0.0" and deletes
the `*_deprecated.yml` files that only worked with rubocop <
0.68. With the deprecated files deleted, it also consolidates the
remaining files into default.yml and rails.yml.
@composerinteralia
Copy link
Member

Bumped to >= 1.0.0 in #101

@koic koic deleted the require_rubocop_0_89_or_higher branch June 27, 2022 17:23
koic added a commit to koic/rubocop-github that referenced this pull request Jun 27, 2022
Follow rubocop/rubocop#7868.

The legacy `Cop::Cop` API is soft deprecated and this PR use
new `Cop::Base` API instead.

> maintain any RuboCop extensions, as the legacy API will be removed in
> RuboCop 2.0.

https://metaredux.com/posts/2020/10/21/rubocop-1-0.html

This new API requires RuboCop 0.87 or higher.
https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md#0870-2020-07-06

Denpendency version of `s.add_dependency "rubocop"` does not need to be
updated in the gemspec if github#86 has been merged first.
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

2 participants