summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-02-10 15:26:23 -0500
committerRobert Speicher <rspeicher@gmail.com>2017-02-13 11:00:20 -0500
commit17c8d15b14f6c3ecc98e1466e9148cf100cc12c6 (patch)
tree6eb652b9051afcd60d11568ab3be095b0207c1c0
parent5db56efe424c9cd760580a755ec4e131d045769d (diff)
downloadgitlab-ce-17c8d15b14f6c3ecc98e1466e9148cf100cc12c6.tar.gz
Enable `Lint/EmptyWhen` cop and correct offense
-rw-r--r--.rubocop.yml4
-rw-r--r--.rubocop_todo.yml4
-rw-r--r--lib/gitlab/diff/parser.rb2
3 files changed, 5 insertions, 5 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 1061de7c797..6e8f599bf25 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -572,6 +572,10 @@ Lint/ElseLayout:
Lint/EmptyEnsure:
Enabled: true
+# Checks for the presence of `when` branches without a body.
+Lint/EmptyWhen:
+ Enabled: true
+
# Align ends correctly.
Lint/EndAlignment:
Enabled: true
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 7ef5523de4b..648b3fc49d2 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -21,10 +21,6 @@ Lint/AmbiguousRegexpLiteral:
Lint/AssignmentInCondition:
Enabled: false
-# Offense count: 1
-Lint/EmptyWhen:
- Enabled: false
-
# Offense count: 20
Lint/HandleExceptions:
Enabled: false
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index 59a2367b65d..89320f5d9dc 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -45,7 +45,7 @@ module Gitlab
line_new += 1
when "-"
line_old += 1
- when "\\"
+ when "\\" # rubocop:disable Lint/EmptyWhen
# No increment
else
line_new += 1