Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0319d5b6
Commit
0319d5b6
authored
Jun 01, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/For rubocop cop
Do not use for, unless you know exactly why. See #17478
parent
473ea1e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
.rubocop.yml
.rubocop.yml
+1
-1
app/models/network/graph.rb
app/models/network/graph.rb
+3
-3
No files found.
.rubocop.yml
View file @
0319d5b6
...
@@ -247,7 +247,7 @@ Style/FlipFlop:
...
@@ -247,7 +247,7 @@ Style/FlipFlop:
# Checks use of for or each in multiline loops.
# Checks use of for or each in multiline loops.
Style/For
:
Style/For
:
Enabled
:
fals
e
Enabled
:
tru
e
# Enforce the use of Kernel#sprintf, Kernel#format or String#%.
# Enforce the use of Kernel#sprintf, Kernel#format or String#%.
Style/FormatString
:
Style/FormatString
:
...
...
app/models/network/graph.rb
View file @
0319d5b6
...
@@ -205,7 +205,7 @@ module Network
...
@@ -205,7 +205,7 @@ module Network
# Visit branching chains
# Visit branching chains
leaves
.
each
do
|
l
|
leaves
.
each
do
|
l
|
parents
=
l
.
parents
(
@map
).
select
{
|
p
|
p
.
space
.
zero?
}
parents
=
l
.
parents
(
@map
).
select
{
|
p
|
p
.
space
.
zero?
}
for
p
in
parents
parents
.
each
do
|
p
|
place_chain
(
p
,
l
.
time
)
place_chain
(
p
,
l
.
time
)
end
end
end
end
...
@@ -223,7 +223,7 @@ module Network
...
@@ -223,7 +223,7 @@ module Network
end
end
def
mark_reserved
(
time_range
,
space
)
def
mark_reserved
(
time_range
,
space
)
for
day
in
time_range
time_range
.
each
do
|
day
|
@reserved
[
day
].
push
(
space
)
@reserved
[
day
].
push
(
space
)
end
end
end
end
...
@@ -232,7 +232,7 @@ module Network
...
@@ -232,7 +232,7 @@ module Network
space_default
||=
space_base
space_default
||=
space_base
reserved
=
[]
reserved
=
[]
for
day
in
time_range
time_range
.
each
do
|
day
|
reserved
.
push
(
*
@reserved
[
day
])
reserved
.
push
(
*
@reserved
[
day
])
end
end
reserved
.
uniq!
reserved
.
uniq!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment