diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-11-30 15:34:29 +0800 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-02-10 17:40:38 -0500 |
commit | 5db56efe424c9cd760580a755ec4e131d045769d (patch) | |
tree | 079042491d8a5a721658f0bed50c5e1f3534830f | |
parent | 92cbc1e4ad8d874428089c4c65293fa218f67206 (diff) | |
download | gitlab-ce-5db56efe424c9cd760580a755ec4e131d045769d.tar.gz |
Enable `Style/RedundantException` cop and correct offense
-rw-r--r-- | .rubocop.yml | 4 | ||||
-rw-r--r-- | .rubocop_todo.yml | 5 | ||||
-rw-r--r-- | app/helpers/preferences_helper.rb | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 21ea8372e4b..1061de7c797 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4714b64b896..7ef5523de4b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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: diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb index 6e68aad4cb7..dd0a4ea03f0 100644 --- a/app/helpers/preferences_helper.rb +++ b/app/helpers/preferences_helper.rb @@ -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, _| |