Separate Ruby (rubocop-github
) from Rails (rubocop-github-rails
) cops and rules to disambiguate rule inheritance from custom cops
#121
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.
This creates clearer distinctions between
inherit_from
, andrequire:
'dThis also creates stronger separation between the generic-Ruby rules (e.g.
config/default.yml
) and the Rails-specific rules (e.g.config/rails.yml
). I believe that will become necessary because of #119, because the current implementation requires all the cops (Ruby and Rails) which means that they will all become Enabled/Pending (or whatever the *ByDefault is) even if the developer only wants the generic-Ruby rules. This PR makes it so thatdefault.yml
will only load/require the generic-Ruby cops and not all the Rails cops, and vice versa.I followed the pattern used in
rubocop-rails
andrubocop-performance
toinject!
Rubocop configuration/rules, along with their pattern of havingEnabled: pending
status.This should be fully backward compatible too and not require any changes by consumers.
Also, I learned a lot about how to package a Rubocop gem and plan to go suggest these changes too on
rubocop-rails-accessibility
(though slightly differently because that gem is just cops).