Enable `Lint/EmptyWhen` cop and correct offense

This commit is contained in:
Robert Speicher 2017-02-10 15:26:23 -05:00
parent 5db56efe42
commit 17c8d15b14
3 changed files with 5 additions and 5 deletions

View File

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

View File

@ -21,10 +21,6 @@ Lint/AmbiguousRegexpLiteral:
Lint/AssignmentInCondition:
Enabled: false
# Offense count: 1
Lint/EmptyWhen:
Enabled: false
# Offense count: 20
Lint/HandleExceptions:
Enabled: false

View File

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