diff --git a/.rubocop.yml b/.rubocop.yml index 1061de7c7978afdf5c89b4b77b1e574bf338638e..6e8f599bf25623c111467da2e27172ff4263dbdc 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 7ef5523de4b55eaa152c9b4903e4ec1702ce9680..648b3fc49d2d08d420a9c5ddb5300e551216dc36 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 59a2367b65d2b01d2e9394e0e3d4302e01c701a9..89320f5d9dc4342bb3266a1ec6c603bf29ed4b9e 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