Commit 38e0e399 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'style/enable-while-until-do-rubocop-style-cop' into 'master'

Enable Style/WhileUntilDo rubocop style cop

Checks for redundant `do` after `while` or `until`.

See #17478

See merge request !4350
parents 8cb7759b 0ea017d9
...@@ -704,7 +704,7 @@ Style/WhenThen: ...@@ -704,7 +704,7 @@ Style/WhenThen:
# Checks for redundant do after while or until. # Checks for redundant do after while or until.
Style/WhileUntilDo: Style/WhileUntilDo:
Enabled: false Enabled: true
# Favor modifier while/until usage when you have a single-line body. # Favor modifier while/until usage when you have a single-line body.
Style/WhileUntilModifier: Style/WhileUntilModifier:
......
...@@ -231,7 +231,7 @@ module Network ...@@ -231,7 +231,7 @@ module Network
reserved.uniq! reserved.uniq!
space = space_default space = space_default
while reserved.include?(space) do while reserved.include?(space)
space += space_step space += space_step
if space < space_base then if space < space_base then
space_step *= -1 space_step *= -1
......
...@@ -56,7 +56,7 @@ module Gitlab ...@@ -56,7 +56,7 @@ module Gitlab
child_pattern = '[^/]*/?$' unless @opts[:recursive] child_pattern = '[^/]*/?$' unless @opts[:recursive]
match_pattern = /^#{Regexp.escape(@path)}#{child_pattern}/ match_pattern = /^#{Regexp.escape(@path)}#{child_pattern}/
until gz.eof? do until gz.eof?
begin begin
path = read_string(gz).force_encoding('UTF-8') path = read_string(gz).force_encoding('UTF-8')
meta = read_string(gz).force_encoding('UTF-8') meta = read_string(gz).force_encoding('UTF-8')
......
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