Enable `Style/RedundantException` cop and correct offense
This commit is contained in:
parent
92cbc1e4ad
commit
5db56efe42
|
@ -339,6 +339,10 @@ Style/OpMethod:
|
|||
Style/ParenthesesAroundCondition:
|
||||
Enabled: true
|
||||
|
||||
# Checks for an obsolete RuntimeException argument in raise/fail.
|
||||
Style/RedundantException:
|
||||
Enabled: true
|
||||
|
||||
# Checks for parentheses that seem not to serve any purpose.
|
||||
Style/RedundantParentheses:
|
||||
Enabled: true
|
||||
|
|
|
@ -416,11 +416,6 @@ Style/RaiseArgs:
|
|||
Style/RedundantBegin:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Style/RedundantException:
|
||||
Enabled: false
|
||||
|
||||
# Offense count: 29
|
||||
# Cop supports --auto-correct.
|
||||
Style/RedundantFreeze:
|
||||
|
|
|
@ -23,7 +23,7 @@ module PreferencesHelper
|
|||
|
||||
if defined.size != DASHBOARD_CHOICES.size
|
||||
# Ensure that anyone adding new options updates this method too
|
||||
raise RuntimeError, "`User` defines #{defined.size} dashboard choices," +
|
||||
raise "`User` defines #{defined.size} dashboard choices," \
|
||||
" but `DASHBOARD_CHOICES` defined #{DASHBOARD_CHOICES.size}."
|
||||
else
|
||||
defined.map do |key, _|
|
||||
|
|
Loading…
Reference in New Issue