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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
170efaab
Commit
170efaab
authored
Dec 16, 2016
by
Rydkin Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/MultilineOperationIndentation in Rubocop, fixes #25741
parent
b1120fc3
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
45 additions
and
44 deletions
+45
-44
.rubocop.yml
.rubocop.yml
+2
-1
app/controllers/jwt_controller.rb
app/controllers/jwt_controller.rb
+1
-1
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+1
-1
app/helpers/form_helper.rb
app/helpers/form_helper.rb
+6
-6
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+9
-9
app/helpers/tab_helper.rb
app/helpers/tab_helper.rb
+3
-3
app/models/member.rb
app/models/member.rb
+2
-2
app/models/network/graph.rb
app/models/network/graph.rb
+2
-2
app/models/project_services/issue_tracker_service.rb
app/models/project_services/issue_tracker_service.rb
+2
-2
app/models/user.rb
app/models/user.rb
+1
-1
app/policies/note_policy.rb
app/policies/note_policy.rb
+1
-1
app/policies/project_policy.rb
app/policies/project_policy.rb
+6
-6
app/services/groups/update_service.rb
app/services/groups/update_service.rb
+1
-1
app/services/issues/update_service.rb
app/services/issues/update_service.rb
+1
-1
app/services/merge_requests/build_service.rb
app/services/merge_requests/build_service.rb
+1
-1
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+1
-1
app/services/projects/update_service.rb
app/services/projects/update_service.rb
+1
-1
config/initializers/sidekiq.rb
config/initializers/sidekiq.rb
+1
-1
lib/gitlab/email/reply_parser.rb
lib/gitlab/email/reply_parser.rb
+1
-1
spec/lib/gitlab/gfm/reference_rewriter_spec.rb
spec/lib/gitlab/gfm/reference_rewriter_spec.rb
+1
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
170efaab
...
...
@@ -292,7 +292,8 @@ Style/MultilineMethodDefinitionBraceLayout:
# Checks indentation of binary operations that span more than one line.
Style/MultilineOperationIndentation
:
Enabled
:
false
Enabled
:
true
EnforcedStyle
:
indented
# Avoid multi-line `? :` (the ternary operator), use if/unless instead.
Style/MultilineTernaryOperator
:
...
...
app/controllers/jwt_controller.rb
View file @
170efaab
...
...
@@ -26,7 +26,7 @@ class JwtController < ApplicationController
@authentication_result
=
Gitlab
::
Auth
.
find_for_git_client
(
login
,
password
,
project:
nil
,
ip:
request
.
ip
)
render_unauthorized
unless
@authentication_result
.
success?
&&
(
@authentication_result
.
actor
.
nil?
||
@authentication_result
.
actor
.
is_a?
(
User
))
(
@authentication_result
.
actor
.
nil?
||
@authentication_result
.
actor
.
is_a?
(
User
))
end
rescue
Gitlab
::
Auth
::
MissingPersonalTokenError
render_missing_personal_token
...
...
app/controllers/sessions_controller.rb
View file @
170efaab
...
...
@@ -114,7 +114,7 @@ class SessionsController < Devise::SessionsController
def
valid_otp_attempt?
(
user
)
user
.
validate_and_consume_otp!
(
user_params
[
:otp_attempt
])
||
user
.
invalidate_otp_backup_code!
(
user_params
[
:otp_attempt
])
user
.
invalidate_otp_backup_code!
(
user_params
[
:otp_attempt
])
end
def
log_audit_event
(
user
,
options
=
{})
...
...
app/helpers/form_helper.rb
View file @
170efaab
...
...
@@ -7,12 +7,12 @@ module FormHelper
content_tag
(
:div
,
class:
'alert alert-danger'
,
id:
'error_explanation'
)
do
content_tag
(
:h4
,
headline
)
<<
content_tag
(
:ul
)
do
model
.
errors
.
full_messages
.
map
{
|
msg
|
content_tag
(
:li
,
msg
)
}.
join
.
html_safe
end
content_tag
(
:ul
)
do
model
.
errors
.
full_messages
.
map
{
|
msg
|
content_tag
(
:li
,
msg
)
}.
join
.
html_safe
end
end
end
end
app/helpers/nav_helper.rb
View file @
170efaab
...
...
@@ -7,12 +7,12 @@ module NavHelper
def
page_gutter_class
if
current_path?
(
'merge_requests#show'
)
||
current_path?
(
'merge_requests#diffs'
)
||
current_path?
(
'merge_requests#commits'
)
||
current_path?
(
'merge_requests#builds'
)
||
current_path?
(
'merge_requests#conflicts'
)
||
current_path?
(
'merge_requests#pipelines'
)
||
current_path?
(
'issues#show'
)
current_path?
(
'merge_requests#diffs'
)
||
current_path?
(
'merge_requests#commits'
)
||
current_path?
(
'merge_requests#builds'
)
||
current_path?
(
'merge_requests#conflicts'
)
||
current_path?
(
'merge_requests#pipelines'
)
||
current_path?
(
'issues#show'
)
if
cookies
[
:collapsed_gutter
]
==
'true'
"page-gutter right-sidebar-collapsed"
else
...
...
@@ -21,9 +21,9 @@ module NavHelper
elsif
current_path?
(
'builds#show'
)
"page-gutter build-sidebar right-sidebar-expanded"
elsif
current_path?
(
'wikis#show'
)
||
current_path?
(
'wikis#edit'
)
||
current_path?
(
'wikis#history'
)
||
current_path?
(
'wikis#git_access'
)
current_path?
(
'wikis#edit'
)
||
current_path?
(
'wikis#history'
)
||
current_path?
(
'wikis#git_access'
)
"page-gutter wiki-sidebar right-sidebar-expanded"
end
end
...
...
app/helpers/tab_helper.rb
View file @
170efaab
...
...
@@ -106,9 +106,9 @@ module TabHelper
def
branches_tab_class
if
current_controller?
(
:protected_branches
)
||
current_controller?
(
:branches
)
||
current_page?
(
namespace_project_repository_path
(
@project
.
namespace
,
@project
))
current_controller?
(
:branches
)
||
current_page?
(
namespace_project_repository_path
(
@project
.
namespace
,
@project
))
'active'
end
end
...
...
app/models/member.rb
View file @
170efaab
...
...
@@ -89,8 +89,8 @@ class Member < ActiveRecord::Base
member
=
if
user
.
is_a?
(
User
)
source
.
members
.
find_by
(
user_id:
user
.
id
)
||
source
.
requesters
.
find_by
(
user_id:
user
.
id
)
||
source
.
members
.
build
(
user_id:
user
.
id
)
source
.
requesters
.
find_by
(
user_id:
user
.
id
)
||
source
.
members
.
build
(
user_id:
user
.
id
)
else
source
.
members
.
build
(
invite_email:
user
)
end
...
...
app/models/network/graph.rb
View file @
170efaab
...
...
@@ -161,8 +161,8 @@ module Network
def
is_overlap?
(
range
,
overlap_space
)
range
.
each
do
|
i
|
if
i
!=
range
.
first
&&
i
!=
range
.
last
&&
@commits
[
i
].
spaces
.
include?
(
overlap_space
)
i
!=
range
.
last
&&
@commits
[
i
].
spaces
.
include?
(
overlap_space
)
return
true
end
...
...
app/models/project_services/issue_tracker_service.rb
View file @
170efaab
...
...
@@ -85,8 +85,8 @@ class IssueTrackerService < Service
def
enabled_in_gitlab_config
Gitlab
.
config
.
issues_tracker
&&
Gitlab
.
config
.
issues_tracker
.
values
.
any?
&&
issues_tracker
Gitlab
.
config
.
issues_tracker
.
values
.
any?
&&
issues_tracker
end
def
issues_tracker
...
...
app/models/user.rb
View file @
170efaab
...
...
@@ -390,7 +390,7 @@ class User < ActiveRecord::Base
def
namespace_uniq
# Return early if username already failed the first uniqueness validation
return
if
errors
.
key?
(
:username
)
&&
errors
[
:username
].
include?
(
'has already been taken'
)
errors
[
:username
].
include?
(
'has already been taken'
)
existing_namespace
=
Namespace
.
by_path
(
username
)
if
existing_namespace
&&
existing_namespace
!=
namespace
...
...
app/policies/note_policy.rb
View file @
170efaab
...
...
@@ -12,7 +12,7 @@ class NotePolicy < BasePolicy
end
if
@subject
.
for_merge_request?
&&
@subject
.
noteable
.
author
==
@user
@subject
.
noteable
.
author
==
@user
can!
:resolve_note
end
end
...
...
app/policies/project_policy.rb
View file @
170efaab
...
...
@@ -3,7 +3,7 @@ class ProjectPolicy < BasePolicy
team_access!
(
user
)
owner
=
project
.
owner
==
user
||
(
project
.
group
&&
project
.
group
.
has_owner?
(
user
))
(
project
.
group
&&
project
.
group
.
has_owner?
(
user
))
owner_access!
if
user
.
admin?
||
owner
team_member_owner_access!
if
owner
...
...
@@ -13,7 +13,7 @@ class ProjectPolicy < BasePolicy
public_access!
if
project
.
request_access_enabled
&&
!
(
owner
||
user
.
admin?
||
project
.
team
.
member?
(
user
)
||
project_group_member?
(
user
))
!
(
owner
||
user
.
admin?
||
project
.
team
.
member?
(
user
)
||
project_group_member?
(
user
))
can!
:request_access
end
end
...
...
@@ -244,10 +244,10 @@ class ProjectPolicy < BasePolicy
def
project_group_member?
(
user
)
project
.
group
&&
(
project
.
group
.
members
.
exists?
(
user_id:
user
.
id
)
||
project
.
group
.
requesters
.
exists?
(
user_id:
user
.
id
)
)
(
project
.
group
.
members
.
exists?
(
user_id:
user
.
id
)
||
project
.
group
.
requesters
.
exists?
(
user_id:
user
.
id
)
)
end
def
named_abilities
(
name
)
...
...
app/services/groups/update_service.rb
View file @
170efaab
...
...
@@ -5,7 +5,7 @@ module Groups
new_visibility
=
params
[
:visibility_level
]
if
new_visibility
&&
new_visibility
.
to_i
!=
group
.
visibility_level
unless
can?
(
current_user
,
:change_visibility_level
,
group
)
&&
Gitlab
::
VisibilityLevel
.
allowed_for?
(
current_user
,
new_visibility
)
Gitlab
::
VisibilityLevel
.
allowed_for?
(
current_user
,
new_visibility
)
deny_visibility_level
(
group
,
new_visibility
)
return
group
...
...
app/services/issues/update_service.rb
View file @
170efaab
...
...
@@ -10,7 +10,7 @@ module Issues
end
if
issue
.
previous_changes
.
include?
(
'title'
)
||
issue
.
previous_changes
.
include?
(
'description'
)
issue
.
previous_changes
.
include?
(
'description'
)
todo_service
.
update_issue
(
issue
,
current_user
)
end
...
...
app/services/merge_requests/build_service.rb
View file @
170efaab
...
...
@@ -42,7 +42,7 @@ module MergeRequests
end
if
merge_request
.
source_project
==
merge_request
.
target_project
&&
merge_request
.
target_branch
==
merge_request
.
source_branch
merge_request
.
target_branch
==
merge_request
.
source_branch
messages
<<
'You must select different branches'
end
...
...
app/services/merge_requests/update_service.rb
View file @
170efaab
...
...
@@ -25,7 +25,7 @@ module MergeRequests
end
if
merge_request
.
previous_changes
.
include?
(
'title'
)
||
merge_request
.
previous_changes
.
include?
(
'description'
)
merge_request
.
previous_changes
.
include?
(
'description'
)
todo_service
.
update_merge_request
(
merge_request
,
current_user
)
end
...
...
app/services/projects/update_service.rb
View file @
170efaab
...
...
@@ -6,7 +6,7 @@ module Projects
if
new_visibility
&&
new_visibility
.
to_i
!=
project
.
visibility_level
unless
can?
(
current_user
,
:change_visibility_level
,
project
)
&&
Gitlab
::
VisibilityLevel
.
allowed_for?
(
current_user
,
new_visibility
)
Gitlab
::
VisibilityLevel
.
allowed_for?
(
current_user
,
new_visibility
)
deny_visibility_level
(
project
,
new_visibility
)
return
project
...
...
config/initializers/sidekiq.rb
View file @
170efaab
...
...
@@ -34,7 +34,7 @@ Sidekiq.configure_server do |config|
# Database pool should be at least `sidekiq_concurrency` + 2
# For more info, see: https://github.com/mperham/sidekiq/blob/master/4.0-Upgrade.md
config
=
ActiveRecord
::
Base
.
configurations
[
Rails
.
env
]
||
Rails
.
application
.
config
.
database_configuration
[
Rails
.
env
]
Rails
.
application
.
config
.
database_configuration
[
Rails
.
env
]
config
[
'pool'
]
=
Sidekiq
.
options
[
:concurrency
]
+
2
ActiveRecord
::
Base
.
establish_connection
(
config
)
Rails
.
logger
.
debug
(
"Connection Pool size for Sidekiq Server is now:
#{
ActiveRecord
::
Base
.
connection
.
pool
.
instance_variable_get
(
'@size'
)
}
"
)
...
...
lib/gitlab/email/reply_parser.rb
View file @
170efaab
...
...
@@ -69,7 +69,7 @@ module Gitlab
# This one might be controversial but so many reply lines have years, times and end with a colon.
# Let's try it and see how well it works.
break
if
(
l
=~
/\d{4}/
&&
l
=~
/\d:\d\d/
&&
l
=~
/\:$/
)
||
(
l
=~
/On \w+ \d+,? \d+,?.*wrote:/
)
(
l
=~
/On \w+ \d+,? \d+,?.*wrote:/
)
# Headers on subsequent lines
break
if
(
0
..
2
).
all?
{
|
off
|
lines
[
idx
+
off
]
=~
REPLYING_HEADER_REGEX
}
...
...
spec/lib/gitlab/gfm/reference_rewriter_spec.rb
View file @
170efaab
...
...
@@ -29,7 +29,7 @@ describe Gitlab::Gfm::ReferenceRewriter do
context
'description with ignored elements'
do
let
(
:text
)
do
"Hi. This references #1, but not `#2`
\n
"
+
'<pre>and not !1</pre>'
'<pre>and not !1</pre>'
end
it
{
is_expected
.
to
include
issue_first
.
to_reference
(
new_project
)
}
...
...
spec/requests/api/projects_spec.rb
View file @
170efaab
...
...
@@ -167,7 +167,7 @@ describe API::Projects, api: true do
expect
(
json_response
).
to
satisfy
do
|
response
|
response
.
one?
do
|
entry
|
entry
.
has_key?
(
'permissions'
)
&&
entry
[
'name'
]
==
project
.
name
&&
entry
[
'name'
]
==
project
.
name
&&
entry
[
'owner'
][
'username'
]
==
user
.
username
end
end
...
...
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