Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
c125658854f1
Commit
9430b781
authored
Jan 16, 2019
by
Rémy Coutable
Browse files
Enable the Layout/ExtraSpacing cop
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
26b2beaf9af5
Changes
236
Hide whitespace changes
Inline
Side-by-side
.rubocop_todo.yml
View file @
c1256588
...
...
@@ -15,12 +15,6 @@ Capybara/CurrentPathExpectation:
Layout/EmptyLinesAroundArguments
:
Enabled
:
false
# Offense count: 253
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Layout/ExtraSpacing
:
Enabled
:
false
# Offense count: 83
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
...
...
app/controllers/passwords_controller.rb
View file @
c1256588
...
...
@@ -5,7 +5,7 @@ class PasswordsController < Devise::PasswordsController
before_action
:resource_from_email
,
only:
[
:create
]
before_action
:check_password_authentication_available
,
only:
[
:create
]
before_action
:throttle_reset
,
only:
[
:create
]
before_action
:throttle_reset
,
only:
[
:create
]
# rubocop: disable CodeReuse/ActiveRecord
def
edit
...
...
app/controllers/projects/commit_controller.rb
View file @
c1256588
...
...
@@ -24,10 +24,10 @@ def show
apply_diff_view_cookie!
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
render
end
format
.
diff
do
format
.
diff
do
send_git_diff
(
@project
.
repository
,
@commit
.
diff_refs
)
end
format
.
patch
do
...
...
app/controllers/projects/discussions_controller.rb
View file @
c1256588
...
...
@@ -40,7 +40,7 @@ def render_discussion
def
render_json_with_discussions_serializer
render
json:
DiscussionSerializer
.
new
(
project:
project
,
noteable:
discussion
.
noteable
,
current_user:
current_user
,
note_entity:
ProjectNoteEntity
)
DiscussionSerializer
.
new
(
project:
project
,
noteable:
discussion
.
noteable
,
current_user:
current_user
,
note_entity:
ProjectNoteEntity
)
.
represent
(
discussion
,
context:
self
,
render_truncated_diff_lines:
true
)
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
c1256588
...
...
@@ -55,7 +55,7 @@ def show
render
json:
serializer
.
represent
(
@merge_request
,
serializer:
params
[
:serializer
])
end
format
.
patch
do
format
.
patch
do
break
render_404
unless
@merge_request
.
diff_refs
send_git_patch
@project
.
repository
,
@merge_request
.
diff_refs
...
...
app/controllers/projects/pages_controller.rb
View file @
c1256588
...
...
@@ -18,7 +18,7 @@ def destroy
project
.
pages_domains
.
destroy_all
# rubocop: disable DestroyAll
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
redirect_to
project_pages_path
(
@project
),
status:
302
,
notice:
'Pages were removed'
...
...
app/graphql/types/permission_types/project.rb
View file @
c1256588
...
...
@@ -8,7 +8,7 @@ class Project < BasePermissionType
abilities
:change_namespace
,
:change_visibility_level
,
:rename_project
,
:remove_project
,
:archive_project
,
:remove_fork_project
,
:remove_pages
,
:read_project
,
:create_merge_request_in
,
:read_wiki
,
:read_project_member
,
:create_issue
,
:upload_file
,
:read_wiki
,
:read_project_member
,
:create_issue
,
:upload_file
,
:read_cycle_analytics
,
:download_code
,
:download_wiki_code
,
:fork_project
,
:create_project_snippet
,
:read_commit_status
,
:request_access
,
:create_pipeline
,
:create_pipeline_schedule
,
...
...
app/helpers/auth_helper.rb
View file @
c1256588
...
...
@@ -31,7 +31,7 @@ def form_based_provider_priority
def
form_based_provider_with_highest_priority
@form_based_provider_with_highest_priority
||=
begin
form_based_provider_priority
.
each
do
|
provider_regexp
|
highest_priority
=
form_based_providers
.
find
{
|
provider
|
provider
.
match?
(
provider_regexp
)
}
highest_priority
=
form_based_providers
.
find
{
|
provider
|
provider
.
match?
(
provider_regexp
)
}
break
highest_priority
unless
highest_priority
.
nil?
end
end
...
...
app/helpers/issuables_helper.rb
View file @
c1256588
...
...
@@ -209,7 +209,7 @@ def issuable_meta(issuable, project, text)
end
def
issuable_labels_tooltip
(
labels
,
limit:
5
)
first
,
last
=
labels
.
partition
.
with_index
{
|
_
,
i
|
i
<
limit
}
first
,
last
=
labels
.
partition
.
with_index
{
|
_
,
i
|
i
<
limit
}
if
labels
&&
labels
.
any?
label_names
=
first
.
collect
{
|
label
|
label
.
fetch
(
:title
)
}
...
...
app/models/clusters/platforms/kubernetes.rb
View file @
c1256588
...
...
@@ -154,7 +154,7 @@ def fallback_default_namespace
def
build_kube_client!
raise
"Incomplete settings"
unless
api_url
raise
"No namespace"
if
cluster
.
project_type?
&&
actual_namespace
.
empty?
# can probably remove this line once we remove #actual_namespace
raise
"No namespace"
if
cluster
.
project_type?
&&
actual_namespace
.
empty?
# can probably remove this line once we remove #actual_namespace
unless
(
username
&&
password
)
||
token
raise
"Either username/password or token is required to access API"
...
...
app/models/concerns/has_status.rb
View file @
c1256588
...
...
@@ -85,11 +85,11 @@ def all_state_names
scope
:running
,
->
{
where
(
status:
'running'
)
}
scope
:pending
,
->
{
where
(
status:
'pending'
)
}
scope
:success
,
->
{
where
(
status:
'success'
)
}
scope
:failed
,
->
{
where
(
status:
'failed'
)
}
scope
:canceled
,
->
{
where
(
status:
'canceled'
)
}
scope
:skipped
,
->
{
where
(
status:
'skipped'
)
}
scope
:manual
,
->
{
where
(
status:
'manual'
)
}
scope
:scheduled
,
->
{
where
(
status:
'scheduled'
)
}
scope
:failed
,
->
{
where
(
status:
'failed'
)
}
scope
:canceled
,
->
{
where
(
status:
'canceled'
)
}
scope
:skipped
,
->
{
where
(
status:
'skipped'
)
}
scope
:manual
,
->
{
where
(
status:
'manual'
)
}
scope
:scheduled
,
->
{
where
(
status:
'scheduled'
)
}
scope
:alive
,
->
{
where
(
status:
[
:created
,
:pending
,
:running
])
}
scope
:created_or_pending
,
->
{
where
(
status:
[
:created
,
:pending
])
}
scope
:running_or_pending
,
->
{
where
(
status:
[
:running
,
:pending
])
}
...
...
app/models/email.rb
View file @
c1256588
...
...
@@ -15,7 +15,7 @@ class Email < ActiveRecord::Base
after_commit
:update_invalid_gpg_signatures
,
if:
->
{
previous_changes
.
key?
(
'confirmed_at'
)
}
devise
:confirmable
self
.
reconfirmable
=
false
# currently email can't be changed, no need to reconfirm
self
.
reconfirmable
=
false
# currently email can't be changed, no need to reconfirm
delegate
:username
,
to: :user
...
...
app/models/group.rb
View file @
c1256588
...
...
@@ -98,7 +98,7 @@ def public_or_visible_to_user(user)
def
select_for_project_authorization
if
current_scope
.
joins_values
.
include?
(
:shared_projects
)
joins
(
'INNER JOIN namespaces project_namespace ON project_namespace.id = projects.namespace_id'
)
.
where
(
'project_namespace.share_with_group_lock = ?'
,
false
)
.
where
(
'project_namespace.share_with_group_lock = ?'
,
false
)
.
select
(
"projects.id AS project_id, LEAST(project_group_links.group_access, members.access_level) AS access_level"
)
else
super
...
...
app/models/member.rb
View file @
c1256588
...
...
@@ -76,7 +76,7 @@ class Member < ActiveRecord::Base
scope
:maintainers
,
->
{
active
.
where
(
access_level:
MAINTAINER
)
}
scope
:masters
,
->
{
maintainers
}
# @deprecated
scope
:owners
,
->
{
active
.
where
(
access_level:
OWNER
)
}
scope
:owners_and_maintainers
,
->
{
active
.
where
(
access_level:
[
OWNER
,
MAINTAINER
])
}
scope
:owners_and_maintainers
,
->
{
active
.
where
(
access_level:
[
OWNER
,
MAINTAINER
])
}
scope
:owners_and_masters
,
->
{
owners_and_maintainers
}
# @deprecated
scope
:order_name_asc
,
->
{
left_join_users
.
reorder
(
Gitlab
::
Database
.
nulls_last_order
(
'users.name'
,
'ASC'
))
}
...
...
app/models/milestone.rb
View file @
c1256588
...
...
@@ -28,7 +28,7 @@ class Milestone < ActiveRecord::Base
has_internal_id
:iid
,
scope: :group
,
init:
->
(
s
)
{
s
&
.
group
&
.
milestones
&
.
maximum
(
:iid
)
}
has_many
:issues
has_many
:labels
,
->
{
distinct
.
reorder
(
'labels.title'
)
},
through: :issues
has_many
:labels
,
->
{
distinct
.
reorder
(
'labels.title'
)
},
through: :issues
has_many
:merge_requests
has_many
:events
,
as: :target
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
...
...
app/models/project_services/irker_service.rb
View file @
c1256588
...
...
@@ -59,7 +59,7 @@ def fields
' append "?key=secretpassword" to the URI (Note that due to a bug, if you '
\
' want to use a password, you have to omit the "#" on the channel). If you '
\
' specify a default IRC URI to prepend before each recipient, you can just '
\
' give a channel name.'
},
' give a channel name.'
},
{
type:
'checkbox'
,
name:
'colorize_messages'
}
]
end
...
...
app/models/snippet.rb
View file @
c1256588
...
...
@@ -50,11 +50,11 @@ def content_html_invalidated?
validates
:visibility_level
,
inclusion:
{
in:
Gitlab
::
VisibilityLevel
.
values
}
# Scopes
scope
:are_internal
,
->
{
where
(
visibility_level:
Snippet
::
INTERNAL
)
}
scope
:are_internal
,
->
{
where
(
visibility_level:
Snippet
::
INTERNAL
)
}
scope
:are_private
,
->
{
where
(
visibility_level:
Snippet
::
PRIVATE
)
}
scope
:are_public
,
->
{
where
(
visibility_level:
Snippet
::
PUBLIC
)
}
scope
:public_and_internal
,
->
{
where
(
visibility_level:
[
Snippet
::
PUBLIC
,
Snippet
::
INTERNAL
])
}
scope
:fresh
,
->
{
order
(
"created_at DESC"
)
}
scope
:fresh
,
->
{
order
(
"created_at DESC"
)
}
scope
:inc_relations_for_view
,
->
{
includes
(
author: :status
)
}
participant
:author
...
...
app/models/user.rb
View file @
c1256588
...
...
@@ -145,7 +145,7 @@ def update_tracked_fields!(request)
has_many
:issue_assignees
has_many
:assigned_issues
,
class_name:
"Issue"
,
through: :issue_assignees
,
source: :issue
has_many
:assigned_merge_requests
,
dependent: :nullify
,
foreign_key: :assignee_id
,
class_name:
"MergeRequest"
# rubocop:disable Cop/ActiveRecordDependent
has_many
:assigned_merge_requests
,
dependent: :nullify
,
foreign_key: :assignee_id
,
class_name:
"MergeRequest"
# rubocop:disable Cop/ActiveRecordDependent
has_many
:custom_attributes
,
class_name:
'UserCustomAttribute'
has_many
:callouts
,
class_name:
'UserCallout'
...
...
app/serializers/pipeline_entity.rb
View file @
c1256588
...
...
@@ -59,7 +59,7 @@ class PipelineEntity < Grape::Entity
pipeline
.
present
.
failure_reason
end
expose
:retry_path
,
if:
->
(
*
)
{
can_retry?
}
do
|
pipeline
|
expose
:retry_path
,
if:
->
(
*
)
{
can_retry?
}
do
|
pipeline
|
retry_project_pipeline_path
(
pipeline
.
project
,
pipeline
)
end
...
...
app/services/boards/issues/move_service.rb
View file @
c1256588
...
...
@@ -50,7 +50,7 @@ def issue_params(issue)
if
move_between_ids
attrs
[
:move_between_ids
]
=
move_between_ids
attrs
[
:board_group_id
]
=
board
.
group
&
.
id
attrs
[
:board_group_id
]
=
board
.
group
&
.
id
end
attrs
...
...
Prev
1
2
3
4
5
…
12
Next
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