Enable `Style/RedundantException` cop and correct offense

This commit is contained in:
Robert Speicher 2016-11-30 15:34:29 +08:00
parent 92cbc1e4ad
commit 5db56efe42
3 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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:

View File

@ -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, _|