summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-30 17:47:59 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-30 17:47:59 +0000
commit7a6d069f419d796acafe8caa203385f510ca94ca (patch)
tree793e061b90c835771815cb559e2727a257352fea
parent1a59b350d84b661af3ebf41ca4c034f29157d92b (diff)
parent7ee9b8e758cb4557afb083b78e56b39f16c0dc57 (diff)
downloadgitlab-ce-7a6d069f419d796acafe8caa203385f510ca94ca.tar.gz
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
-rw-r--r--.rubocop.yml2
-rw-r--r--app/models/network/graph.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index e884cfd8ed3..79f32eedee6 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -362,7 +362,7 @@ Style/MultilineHashBraceLayout:
# Do not use then for multi-line if/unless.
Style/MultilineIfThen:
- Enabled: false
+ Enabled: true
# Checks that the closing brace in a method call is either on the same line as
# the last method argument, or a new line.
diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb
index ec32b509ee0..32d0962185b 100644
--- a/app/models/network/graph.rb
+++ b/app/models/network/graph.rb
@@ -89,7 +89,7 @@ module Network
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.
offset - self.class.max_count / 2
else
@@ -130,7 +130,7 @@ module Network
commit.parents(@map).each do |parent|
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)
else
find_free_parent_space(range, commit.space, -1, parent.space)
@@ -144,7 +144,7 @@ module Network
end
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)
else
space_default
@@ -155,7 +155,7 @@ module Network
range.each do |i|
if i != range.first &&
i != range.last &&
- @commits[i].spaces.include?(overlap_space) then
+ @commits[i].spaces.include?(overlap_space)
return true;
end
@@ -233,7 +233,7 @@ module Network
space = space_default
while reserved.include?(space)
space += space_step
- if space < space_base then
+ if space < space_base
space_step *= -1
space = space_base + space_step
end