-
Notifications
You must be signed in to change notification settings - Fork 17
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
Consider removing DisabledByDefault: true
from inherit_gem
configuration
#14
Comments
Firstly, rubocop-rails-omakase considers building rules from scratch if they don't align with specific use cases: Furthermore, using This suggests that use cases unable to continue with As a side note, Jeremy Evans' "Polished Ruby Programming" also presents an approach using |
I appreciate that feedback! Here's what "Polished Ruby Programming" says about it:
The context I'll offer in response to that is that Rubocop frequently serves more purposes than solely debatable stylistic rules. In my experience, rules also exist for Security, Availability, and Performance reasons, which are "written in blood" so to speak. It was these in particular that caused us concern when we discovered that Another alternative, that hopefully wouldn't add too much complexity, would be to offer separate files for individual Cop rules (
|
The other learning I should describe from
Adding a global Ok, I think that describes all of my learnings 😊 |
From the documentation linked above, it sounds like (ISTM the ideal would be that Rubocop would offer a |
Well, you're more than welcome to request such changes on RuboCop's issue tracker. I'm often surprised in how different teams are using RuboCop, so it's good to keep track of their use-cases in a central place.
Perhaps we can make the current setting more flexible - e.g. other than the boolean values it can have something like a list of departments to disable explicitly, which I think would be the most flexible option for everyone. (think |
Precisely this.
Worth exploring this route in a PR if anyone's game. |
When maintaining a project Rubocop file, it becomes troublesome when an
inherit_gem:
configuration containsDisabledByDefault: true
because it applies to the entire project's Rubocop configuration and is difficult to override.We struggled with this when updating our
github-rubocop
rules, which are intended to behave in a similarinherit_gem:
configuration. To summarize:DisabledByDefault: true
changes all rules in a project to be "opt-in rather than opt-out", and requires explicitly enabling any new rule as other Rubocop gems are updated.inherit_gem:
..rubocop.yml
, and those custom cops never run because all cops are disabled unless explicitly enabled.The ideal configuration we arrived at is:
DisabledByDefault: true
to the base set of rules (e.g. this repo).DisabledByDefault: true
to their ownrubocop.yml
if they want all their rules to be explicitly opt-in.The text was updated successfully, but these errors were encountered: