Commit 5db56efe authored by Robert Speicher's avatar Robert Speicher

Enable `Style/RedundantException` cop and correct offense

parent 92cbc1e4
...@@ -339,6 +339,10 @@ Style/OpMethod: ...@@ -339,6 +339,10 @@ Style/OpMethod:
Style/ParenthesesAroundCondition: Style/ParenthesesAroundCondition:
Enabled: true 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. # Checks for parentheses that seem not to serve any purpose.
Style/RedundantParentheses: Style/RedundantParentheses:
Enabled: true Enabled: true
......
...@@ -416,11 +416,6 @@ Style/RaiseArgs: ...@@ -416,11 +416,6 @@ Style/RaiseArgs:
Style/RedundantBegin: Style/RedundantBegin:
Enabled: false Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantException:
Enabled: false
# Offense count: 29 # Offense count: 29
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/RedundantFreeze: Style/RedundantFreeze:
......
...@@ -23,7 +23,7 @@ module PreferencesHelper ...@@ -23,7 +23,7 @@ module PreferencesHelper
if defined.size != DASHBOARD_CHOICES.size if defined.size != DASHBOARD_CHOICES.size
# Ensure that anyone adding new options updates this method too # 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}." " but `DASHBOARD_CHOICES` defined #{DASHBOARD_CHOICES.size}."
else else
defined.map do |key, _| defined.map do |key, _|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment