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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c6f9a1c2
Commit
c6f9a1c2
authored
Jun 30, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/IdenticalConditionalBranches Rubocop cop
parent
2c650b6f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
23 deletions
+14
-23
.rubocop.yml
.rubocop.yml
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+2
-2
app/models/project_services/irker_service.rb
app/models/project_services/irker_service.rb
+2
-2
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+3
-8
lib/rouge/formatters/html_gitlab.rb
lib/rouge/formatters/html_gitlab.rb
+6
-10
No files found.
.rubocop.yml
View file @
c6f9a1c2
...
@@ -284,7 +284,7 @@ Style/IfWithSemicolon:
...
@@ -284,7 +284,7 @@ Style/IfWithSemicolon:
# Checks that conditional statements do not have an identical line at the
# Checks that conditional statements do not have an identical line at the
# end of each branch, which can validly be moved out of the conditional.
# end of each branch, which can validly be moved out of the conditional.
Style/IdenticalConditionalBranches
:
Style/IdenticalConditionalBranches
:
Enabled
:
fals
e
Enabled
:
tru
e
# Checks the indentation of the first line of the right-hand-side of a
# Checks the indentation of the first line of the right-hand-side of a
# multi-line assignment.
# multi-line assignment.
...
...
app/controllers/projects_controller.rb
View file @
c6f9a1c2
...
@@ -53,11 +53,11 @@ class ProjectsController < Projects::ApplicationController
...
@@ -53,11 +53,11 @@ class ProjectsController < Projects::ApplicationController
notice:
"Project '
#{
@project
.
name
}
' was successfully updated."
notice:
"Project '
#{
@project
.
name
}
' was successfully updated."
)
)
end
end
format
.
js
else
else
format
.
html
{
render
'edit'
}
format
.
html
{
render
'edit'
}
format
.
js
end
end
format
.
js
end
end
end
end
...
...
app/models/project_services/irker_service.rb
View file @
c6f9a1c2
...
@@ -114,13 +114,13 @@ class IrkerService < Service
...
@@ -114,13 +114,13 @@ class IrkerService < Service
if
uri
.
is_a?
(
URI
)
&&
uri
.
scheme
[
/^ircs?\z/
]
&&
!
uri
.
path
.
nil?
if
uri
.
is_a?
(
URI
)
&&
uri
.
scheme
[
/^ircs?\z/
]
&&
!
uri
.
path
.
nil?
# Do not authorize irc://domain.com/
# Do not authorize irc://domain.com/
if
uri
.
fragment
.
nil?
&&
uri
.
path
.
length
>
1
if
uri
.
fragment
.
nil?
&&
uri
.
path
.
length
>
1
uri
.
to_s
else
else
# Authorize irc://domain.com/smthg#chan
# Authorize irc://domain.com/smthg#chan
# The irker daemon will deal with it by concatenating smthg and
# The irker daemon will deal with it by concatenating smthg and
# chan, thus sending messages on #smthgchan
# chan, thus sending messages on #smthgchan
uri
.
to_s
end
end
uri
.
to_s
end
end
end
end
end
end
app/services/merge_requests/refresh_service.rb
View file @
c6f9a1c2
...
@@ -61,19 +61,14 @@ module MergeRequests
...
@@ -61,19 +61,14 @@ module MergeRequests
merge_requests
.
each
do
|
merge_request
|
merge_requests
.
each
do
|
merge_request
|
if
merge_request
.
source_branch
==
@branch_name
||
force_push?
if
merge_request
.
source_branch
==
@branch_name
||
force_push?
merge_request
.
reload_diff
merge_request
.
reload_diff
merge_request
.
mark_as_unchecked
else
else
mr_commit_ids
=
merge_request
.
commits
.
map
(
&
:id
)
mr_commit_ids
=
merge_request
.
commits
.
map
(
&
:id
)
push_commit_ids
=
@commits
.
map
(
&
:id
)
push_commit_ids
=
@commits
.
map
(
&
:id
)
matches
=
mr_commit_ids
&
push_commit_ids
matches
=
mr_commit_ids
&
push_commit_ids
merge_request
.
reload_diff
if
matches
.
any?
end
if
matches
.
any?
merge_request
.
reload_diff
merge_request
.
mark_as_unchecked
merge_request
.
mark_as_unchecked
else
merge_request
.
mark_as_unchecked
end
end
end
end
end
end
...
...
lib/rouge/formatters/html_gitlab.rb
View file @
c6f9a1c2
...
@@ -143,18 +143,14 @@ module Rouge
...
@@ -143,18 +143,14 @@ module Rouge
'</span>'
'</span>'
end
end
end
end
lines
.
join
(
"
\n
"
)
elsif
@linenos
==
'inline'
else
if
@linenos
==
'inline'
lines
=
lines
.
each_with_index
.
map
do
|
line
,
index
|
lines
=
lines
.
each_with_index
.
map
do
|
line
,
index
|
number
=
index
+
@linenostart
number
=
index
+
@linenostart
"<span class=
\"
linenos
\"
>
#{
number
}
</span>
#{
line
}
"
"<span class=
\"
linenos
\"
>
#{
number
}
</span>
#{
line
}
"
end
end
lines
.
join
(
"
\n
"
)
else
lines
.
join
(
"
\n
"
)
end
end
end
lines
.
join
(
"
\n
"
)
end
end
def
span
(
tok
,
val
)
def
span
(
tok
,
val
)
...
...
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