Commit 7a6d069f authored by Robert Speicher's avatar Robert Speicher

Merge branch 'style/enable-multiline-if-then-rubocop-cop' into 'master'

Enable Style/MultilineIfThen rubocop cop

Do not use then for multi-line if.

See #7478.

See merge request !4353
parents 1a59b350 7ee9b8e7
...@@ -362,7 +362,7 @@ Style/MultilineHashBraceLayout: ...@@ -362,7 +362,7 @@ Style/MultilineHashBraceLayout:
# Do not use then for multi-line if/unless. # Do not use then for multi-line if/unless.
Style/MultilineIfThen: Style/MultilineIfThen:
Enabled: false Enabled: true
# Checks that the closing brace in a method call is either on the same line as # Checks that the closing brace in a method call is either on the same line as
# the last method argument, or a new line. # the last method argument, or a new line.
......
...@@ -89,7 +89,7 @@ module Network ...@@ -89,7 +89,7 @@ module Network
end end
end end
if self.class.max_count / 2 < offset then if self.class.max_count / 2 < offset
# get max index that commit is displayed in the center. # get max index that commit is displayed in the center.
offset - self.class.max_count / 2 offset - self.class.max_count / 2
else else
...@@ -130,7 +130,7 @@ module Network ...@@ -130,7 +130,7 @@ module Network
commit.parents(@map).each do |parent| commit.parents(@map).each do |parent|
range = commit.time..parent.time range = commit.time..parent.time
space = if commit.space >= parent.space then space = if commit.space >= parent.space
find_free_parent_space(range, parent.space, -1, commit.space) find_free_parent_space(range, parent.space, -1, commit.space)
else else
find_free_parent_space(range, commit.space, -1, parent.space) find_free_parent_space(range, commit.space, -1, parent.space)
...@@ -144,7 +144,7 @@ module Network ...@@ -144,7 +144,7 @@ module Network
end end
def find_free_parent_space(range, space_base, space_step, space_default) def find_free_parent_space(range, space_base, space_step, space_default)
if is_overlap?(range, space_default) then if is_overlap?(range, space_default)
find_free_space(range, space_step, space_base, space_default) find_free_space(range, space_step, space_base, space_default)
else else
space_default space_default
...@@ -155,7 +155,7 @@ module Network ...@@ -155,7 +155,7 @@ module Network
range.each do |i| range.each do |i|
if i != range.first && if i != range.first &&
i != range.last && i != range.last &&
@commits[i].spaces.include?(overlap_space) then @commits[i].spaces.include?(overlap_space)
return true; return true;
end end
...@@ -233,7 +233,7 @@ module Network ...@@ -233,7 +233,7 @@ module Network
space = space_default space = space_default
while reserved.include?(space) while reserved.include?(space)
space += space_step space += space_step
if space < space_base then if space < space_base
space_step *= -1 space_step *= -1
space = space_base + space_step space = space_base + space_step
end end
......
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