Skip to content

Commit

Permalink
rubocop/config/default: Unset DisabledByDefault
Browse files Browse the repository at this point in the history
- The `DisabledByDefault` config option made it so that "all cops in the
  default configuration are disabled, and only cops in user
  configuration are enabled", which makes cops "opt-in rather than
  opt-out" (source:
  https://github.com/rubocop/rubocop/blob/d1270c468cdb9a211229e36aef8d568ae3bfe607/config/default.yml#L91-L102).
- It's not immediately obvious that this gem has this config option.
  This means that people may write new, custom cops in downstream
  projects, with no configuration in .rubocop.yml, and then they never run
  because all cops are disabled unless explicitly enabled or otherwise
  configured with `Include`/`Exclude`.
- RuboCop does not warn users that the config inheritance has set
  `DisabledByDefault` somewhere up the line, leading to users mistakenly
  not enabling cops they may have intended to.
- Other of GitHub's open source gems, like `rubocop-github`[1] and
  `rubocop-rails-accessibility`[2], have moved away from
  `DisabledByDefault`. This is the last one (at least that I can find in
  GitHub's main project's RuboCop gem inheritance tree).

[1] - github/rubocop-github#119
[2] - github/rubocop-rails-accessibility#7
  • Loading branch information
issyl0 committed Oct 21, 2022
1 parent 1724aa2 commit 3b811c9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions lib/rubocop/config/default.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
require:
- rubocop/cop/primer

AllCops:
DisabledByDefault: true

Primer/SystemArgumentInsteadOfClass:
Enabled: true

Expand Down

0 comments on commit 3b811c9

Please sign in to comment.