Enable Style/InvertibleUnlessCondition cop

This commit is contained in:
Douglas Eichelberger 2023-04-18 15:06:41 -07:00
parent 3b92bb9da5
commit cccbb5c705

View File

@ -373,6 +373,17 @@ Style/HashAsLastArrayItem:
- "/**/Formula/**/*.rb" - "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb" - "**/Formula/**/*.rb"
Style/InvertibleUnlessCondition:
inherit_mode:
override:
- InverseMethods
Enabled: true
InverseMethods:
# Favor `if a != b` over `unless a == b`
:==: :!=
# Unset this (prefer `unless a.zero?` over `if a.nonzero?`)
:zero?:
# would rather freeze too much than too little # would rather freeze too much than too little
Style/MutableConstant: Style/MutableConstant:
EnforcedStyle: strict EnforcedStyle: strict