Skip to content

Commit

Permalink
Replace Rails/NegateInclude with Inverse/Invertible cops
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Jan 19, 2024
1 parent 36024e2 commit ec979fe
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ Rails/Blank:
Enabled: true
Rails/CompactBlank:
Enabled: true
Rails/NegateInclude:
Enabled: true
Rails/Presence:
Enabled: true
Rails/Present:
Expand Down Expand Up @@ -354,15 +352,30 @@ Style/HashAsLastArrayItem:
- "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb"

Style/InverseMethods:
Exclude:
# `exclude?` is not available everywhere
- "Homebrew/rubocops/**/*.rb"
- "Homebrew/sorbet/tapioca/require.rb"
- "Homebrew/standalone/init.rb"
InverseMethods:
:include?: :exclude?
:exclude?: :include?

Style/InvertibleUnlessCondition:
Enabled: true
Exclude:
# `exclude?` is not available everywhere
- "Homebrew/rubocops/**/*.rb"
- "Homebrew/sorbet/tapioca/require.rb"
- "Homebrew/standalone/init.rb"
InverseMethods:
# Favor `if a != b` over `unless a == b`
:==: :!=
# Unset this (prefer `unless a.zero?` over `if a.nonzero?`)
:zero?:
# Don't require non-standard `exclude?` (for now at least) - it's not available in every file
:include?:
:include?: :exclude?
:exclude?: :include?

Style/MutableConstant:
# would rather freeze too much than too little
Expand Down

0 comments on commit ec979fe

Please sign in to comment.