Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In preparation for moving some things to Ruby 2.7, we need to eventually use rubocop ≥ 0.7x so that the new language version is recognized by rubocop. This PR is my best effort to allow an incremental upgrade strategy without totally breaking backwards compatibility. My thought is that since rubocop 1.0 is nearing completion, this gem could continue to also be pre-1.0 and try to maintain backwards compatibility. However, my definition of backwards compatibility would be that upgrading to a new patch or minor version of
rubocop-github
should not introduce any new cop offenses. This might not be the best strategy since the rubocop authors have said that even though the API of rubocop itself will stabilize and follow semantic versioning after 1.0, the cops will continue to introduce "breaking changes" meaning that it will be allowed to introduce a new cop in a patch or minor version that is turned on by default so upgrading to these versions could introduce new offenses even after following semantic versioning (see rubocop/rubocop#5612). So, I'm happy to change this to be simpler if it makes sense to do so. FWIW, this may all seem like over-engineering, but because of #46 I figured I should make an attempt at backwards compatibility. Because the gem is pre 1.0, I think it would be valid and much simpler to just make the changes directly, so I'm happy/eager to simplify this PR if backwards compatibility is not required.Changes
config/_default_shared.yml
andconfig/_rails_shared.yml
. These files are intended to be inherited by higher level configs.config/default_deprecated.yml
. The only behavior of this file currently is to pull inconfig/_default_shared.yml
and setDisabledByDefault
totrue
. If there are breaking changes to cops, they could be put here in further upgrades. For instance, if the name of a cop is changed, the old name could be put indefault_deprecated.yml
and the new name could be put indefault_edge.yml
. Currently, all cop names are the same across the supported versions of rubocop, but this could change. The reasoning behind puttingDisabledByDefault: true
in the deprecated config is that it seems like a gem should not be so opinionated and leave this sort of global configuration to the client. It could break existing clients to remove it though, so I thought it should still be part of the default path.stderr
. I don't think it's appropriate to do that now, but I think the last version ofrubocop-github
before 1.0 could add this so that it could warn users to upgrade. My main motivation was allowing incremental upgrade, though, so I left out the warning message.config/default.yml
simply inheritsconfig/default_deprecated.yml
so as not to break any clients who require that file.config/default_edge.yml
is intended to be used on the latest version of rubocop in which the performance cops have been extracted to a gem. I left the performance cops inconfig/_default_shared.yml
and requiredrubocop-performance
inconfig/default_edge.yml
even though the gem is not listed in the gemspec. Unfortunately,rubocop-rails
andrubocop-performance
both require a very recent version of rubocop so it would have prevented the incremental upgrade of rubocop.config/rails.yml
as well.