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
030baf70
Commit
030baf70
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Performance/RedundantMerge
parent
c5a49cc3
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
20 additions
and
24 deletions
+20
-24
.rubocop.yml
.rubocop.yml
+4
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-6
app/helpers/sorting_helper.rb
app/helpers/sorting_helper.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/models/project_services/pushover_service.rb
app/models/project_services/pushover_service.rb
+1
-1
app/services/protected_branches/api_update_service.rb
app/services/protected_branches/api_update_service.rb
+4
-4
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+1
-3
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
features/steps/shared/issuable.rb
features/steps/shared/issuable.rb
+1
-1
lib/api/users.rb
lib/api/users.rb
+1
-1
lib/gitlab/github_import/importer.rb
lib/gitlab/github_import/importer.rb
+1
-1
spec/finders/notes_finder_spec.rb
spec/finders/notes_finder_spec.rb
+1
-1
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+2
-2
No files found.
.rubocop.yml
View file @
030baf70
...
@@ -889,6 +889,10 @@ Lint/Loop:
...
@@ -889,6 +889,10 @@ Lint/Loop:
Metrics/BlockLength
:
Metrics/BlockLength
:
Enabled
:
false
Enabled
:
false
Performance/RedundantMerge
:
Enabled
:
true
MaxKeyValuePairs
:
1
RSpec/LetSetup
:
RSpec/LetSetup
:
Enabled
:
false
Enabled
:
false
...
...
.rubocop_todo.yml
View file @
030baf70
...
@@ -51,12 +51,6 @@ Performance/RedundantMatch:
...
@@ -51,12 +51,6 @@ Performance/RedundantMatch:
-
'
lib/gitlab/diff/highlight.rb'
-
'
lib/gitlab/diff/highlight.rb'
-
'
lib/gitlab/diff/parser.rb'
-
'
lib/gitlab/diff/parser.rb'
# Offense count: 25
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge
:
Enabled
:
false
# Offense count: 15
# Offense count: 15
# Configuration parameters: CustomIncludeMethods.
# Configuration parameters: CustomIncludeMethods.
RSpec/EmptyExampleGroup
:
RSpec/EmptyExampleGroup
:
...
...
app/helpers/sorting_helper.rb
View file @
030baf70
...
@@ -30,7 +30,7 @@ module SortingHelper
...
@@ -30,7 +30,7 @@ module SortingHelper
}
}
if
current_controller?
(
'admin/projects'
)
if
current_controller?
(
'admin/projects'
)
options
.
merge!
(
sort_value_largest_repo
=>
sort_title_largest_repo
)
options
[
sort_value_largest_repo
]
=
sort_title_largest_repo
end
end
options
options
...
...
app/models/concerns/issuable.rb
View file @
030baf70
...
@@ -235,7 +235,7 @@ module Issuable
...
@@ -235,7 +235,7 @@ module Issuable
# DEPRECATED
# DEPRECATED
repository:
project
.
hook_attrs
.
slice
(
:name
,
:url
,
:description
,
:homepage
)
repository:
project
.
hook_attrs
.
slice
(
:name
,
:url
,
:description
,
:homepage
)
}
}
hook_data
.
merge!
(
assignee:
assignee
.
hook_attrs
)
if
assignee
hook_data
[
:assignee
]
=
assignee
.
hook_attrs
if
assignee
hook_data
hook_data
end
end
...
...
app/models/merge_request.rb
View file @
030baf70
...
@@ -527,7 +527,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -527,7 +527,7 @@ class MergeRequest < ActiveRecord::Base
}
}
if
diff_head_commit
if
diff_head_commit
attrs
.
merge!
(
last_commit:
diff_head_commit
.
hook_attrs
)
attrs
[
:last_commit
]
=
diff_head_commit
.
hook_attrs
end
end
attributes
.
merge!
(
attrs
)
attributes
.
merge!
(
attrs
)
...
...
app/models/project_services/pushover_service.rb
View file @
030baf70
...
@@ -97,7 +97,7 @@ class PushoverService < Service
...
@@ -97,7 +97,7 @@ class PushoverService < Service
# Sound parameter MUST NOT be sent to API if not selected
# Sound parameter MUST NOT be sent to API if not selected
if
sound
if
sound
pushover_data
.
merge!
(
sound:
sound
)
pushover_data
[
:sound
]
=
sound
end
end
PushoverService
.
post
(
'/messages.json'
,
body:
pushover_data
)
PushoverService
.
post
(
'/messages.json'
,
body:
pushover_data
)
...
...
app/services/protected_branches/api_update_service.rb
View file @
030baf70
...
@@ -15,16 +15,16 @@ module ProtectedBranches
...
@@ -15,16 +15,16 @@ module ProtectedBranches
case
@developers_can_push
case
@developers_can_push
when
true
when
true
params
.
merge!
(
push_access_levels_attributes:
[{
access_level:
Gitlab
::
Access
::
DEVELOPER
}])
params
[
:push_access_levels_attributes
]
=
[{
access_level:
Gitlab
::
Access
::
DEVELOPER
}]
when
false
when
false
params
.
merge!
(
push_access_levels_attributes:
[{
access_level:
Gitlab
::
Access
::
MASTER
}])
params
[
:push_access_levels_attributes
]
=
[{
access_level:
Gitlab
::
Access
::
MASTER
}]
end
end
case
@developers_can_merge
case
@developers_can_merge
when
true
when
true
params
.
merge!
(
merge_access_levels_attributes:
[{
access_level:
Gitlab
::
Access
::
DEVELOPER
}])
params
[
:merge_access_levels_attributes
]
=
[{
access_level:
Gitlab
::
Access
::
DEVELOPER
}]
when
false
when
false
params
.
merge!
(
merge_access_levels_attributes:
[{
access_level:
Gitlab
::
Access
::
MASTER
}])
params
[
:merge_access_levels_attributes
]
=
[{
access_level:
Gitlab
::
Access
::
MASTER
}]
end
end
service
=
ProtectedBranches
::
UpdateService
.
new
(
@project
,
@current_user
,
@params
)
service
=
ProtectedBranches
::
UpdateService
.
new
(
@project
,
@current_user
,
@params
)
...
...
app/services/system_hooks_service.rb
View file @
030baf70
...
@@ -33,9 +33,7 @@ class SystemHooksService
...
@@ -33,9 +33,7 @@ class SystemHooksService
data
.
merge!
(
project_data
(
model
))
data
.
merge!
(
project_data
(
model
))
if
event
==
:rename
||
event
==
:transfer
if
event
==
:rename
||
event
==
:transfer
data
.
merge!
({
data
[
:old_path_with_namespace
]
=
model
.
old_path_with_namespace
old_path_with_namespace:
model
.
old_path_with_namespace
})
end
end
data
data
...
...
app/services/system_note_service.rb
View file @
030baf70
...
@@ -359,7 +359,7 @@ module SystemNoteService
...
@@ -359,7 +359,7 @@ module SystemNoteService
if
noteable
.
kind_of?
(
Commit
)
if
noteable
.
kind_of?
(
Commit
)
note_options
.
merge!
(
noteable_type:
'Commit'
,
commit_id:
noteable
.
id
)
note_options
.
merge!
(
noteable_type:
'Commit'
,
commit_id:
noteable
.
id
)
else
else
note_options
.
merge!
(
noteable:
noteable
)
note_options
[
:noteable
]
=
noteable
end
end
if
noteable
.
is_a?
(
ExternalIssue
)
if
noteable
.
is_a?
(
ExternalIssue
)
...
...
features/steps/shared/issuable.rb
View file @
030baf70
...
@@ -153,7 +153,7 @@ module SharedIssuable
...
@@ -153,7 +153,7 @@ module SharedIssuable
case
type
case
type
when
:issue
when
:issue
attrs
.
merge!
(
project:
project
)
attrs
[
:project
]
=
project
when
:merge_request
when
:merge_request
attrs
.
merge!
(
attrs
.
merge!
(
source_project:
project
,
source_project:
project
,
...
...
lib/api/users.rb
View file @
030baf70
...
@@ -172,7 +172,7 @@ module API
...
@@ -172,7 +172,7 @@ module API
end
end
end
end
user_params
.
merge!
(
password_expires_at:
Time
.
now
)
if
user_params
[
:password
].
present?
user_params
[
:password_expires_at
]
=
Time
.
now
if
user_params
[
:password
].
present?
if
user
.
update_attributes
(
user_params
.
except
(
:extern_uid
,
:provider
))
if
user
.
update_attributes
(
user_params
.
except
(
:extern_uid
,
:provider
))
present
user
,
with:
Entities
::
UserPublic
present
user
,
with:
Entities
::
UserPublic
...
...
lib/gitlab/github_import/importer.rb
View file @
030baf70
...
@@ -285,7 +285,7 @@ module Gitlab
...
@@ -285,7 +285,7 @@ module Gitlab
def
fetch_resources
(
resource_type
,
*
opts
)
def
fetch_resources
(
resource_type
,
*
opts
)
return
if
imported?
(
resource_type
)
return
if
imported?
(
resource_type
)
opts
.
last
.
merge!
(
page:
current_page
(
resource_type
)
)
opts
.
last
[
:page
]
=
current_page
(
resource_type
)
client
.
public_send
(
resource_type
,
*
opts
)
do
|
resources
|
client
.
public_send
(
resource_type
,
*
opts
)
do
|
resources
|
yield
resources
yield
resources
...
...
spec/finders/notes_finder_spec.rb
View file @
030baf70
...
@@ -111,7 +111,7 @@ describe NotesFinder do
...
@@ -111,7 +111,7 @@ describe NotesFinder do
end
end
it
'raises an exception for an invalid target_type'
do
it
'raises an exception for an invalid target_type'
do
params
.
merge!
(
target_type:
'invalid'
)
params
[
:target_type
]
=
'invalid'
expect
{
described_class
.
new
(
project
,
user
,
params
).
execute
}.
to
raise_error
(
'invalid target_type'
)
expect
{
described_class
.
new
(
project
,
user
,
params
).
execute
}.
to
raise_error
(
'invalid target_type'
)
end
end
...
...
spec/services/projects/create_service_spec.rb
View file @
030baf70
...
@@ -50,7 +50,7 @@ describe Projects::CreateService, '#execute', services: true do
...
@@ -50,7 +50,7 @@ describe Projects::CreateService, '#execute', services: true do
context
'error handling'
do
context
'error handling'
do
it
'handles invalid options'
do
it
'handles invalid options'
do
opts
.
merge!
({
default_branch:
'master'
}
)
opts
[
:default_branch
]
=
'master'
expect
(
create_project
(
user
,
opts
)).
to
eq
(
nil
)
expect
(
create_project
(
user
,
opts
)).
to
eq
(
nil
)
end
end
end
end
...
@@ -67,7 +67,7 @@ describe Projects::CreateService, '#execute', services: true do
...
@@ -67,7 +67,7 @@ describe Projects::CreateService, '#execute', services: true do
context
'wiki_enabled false does not create wiki repository directory'
do
context
'wiki_enabled false does not create wiki repository directory'
do
it
do
it
do
opts
.
merge!
(
wiki_enabled:
false
)
opts
[
:wiki_enabled
]
=
false
project
=
create_project
(
user
,
opts
)
project
=
create_project
(
user
,
opts
)
path
=
ProjectWiki
.
new
(
project
,
user
).
send
(
:path_to_repo
)
path
=
ProjectWiki
.
new
(
project
,
user
).
send
(
:path_to_repo
)
...
...
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