Separate Ruby (rubocop-github) from Rails (rubocop-github-rails) cops and rules to disambiguate rule inheritance from custom cops#121
Merged
bensheldon merged 1 commit intomasterfrom Oct 13, 2022
Conversation
elenatanasoiu
approved these changes
Oct 12, 2022
Contributor
There was a problem hiding this comment.
Thanks for working with us on this and paving the way for #119! ❤️
Contributor
|
Where does |
Contributor
|
Never mind, I think I understand this now - it's the config stuff further down in the PR. |
sampart
approved these changes
Oct 13, 2022
Contributor
sampart
left a comment
There was a problem hiding this comment.
I won't claim to have completely wrapped my head around this, but looks fine to me.
…cops and rules to disambiguate rule inheritance from custom cops
6945049 to
c49a2ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.ymlwill only load/require the generic-Ruby cops and not all the Rails cops, and vice versa.I followed the pattern used in
rubocop-railsandrubocop-performancetoinject!Rubocop configuration/rules, along with their pattern of havingEnabled: pendingstatus.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).