summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-23 18:47:05 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-23 18:47:05 +0000
commit165834b37326267ba78476adda52c5b92f369f38 (patch)
tree3dfdd33610c62d3cc854ea8819d51ffbd51f6ebf
parent42aca7df0878428328601f75d6576f76d856d464 (diff)
parent17eaecd6c7cb33d0f171ae10da190fa120a817f3 (diff)
downloadgitlab-ce-165834b37326267ba78476adda52c5b92f369f38.tar.gz
Merge branch 'complexity/rubocop-style-loop' into 'master'
Enable Style/InfiniteLoop Rubocop cop This MR enabled Style/InfiniteLoop Rubocop cop, and fixes offenses. See https://gitlab.com/gitlab-org/gitlab-ce/issues/17478 See merge request !4257
-rw-r--r--.rubocop.yml2
-rw-r--r--app/models/network/graph.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 9f91ee0bde0..2997bf5d14b 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -299,7 +299,7 @@ Style/IndentHash:
# Use Kernel#loop for infinite loops.
Style/InfiniteLoop:
- Enabled: false
+ Enabled: true
# Use the new lambda literal syntax for single-line blocks.
Style/Lambda:
diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb
index f4e90125373..9259cb1a0fa 100644
--- a/app/models/network/graph.rb
+++ b/app/models/network/graph.rb
@@ -253,7 +253,7 @@ module Network
leaves = []
leaves.push(commit) if commit.space.zero?
- while true
+ loop do
return leaves if commit.parents(@map).count.zero?
commit = commit.parents(@map).first