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
17deaaff
Commit
17deaaff
authored
Mar 18, 2021
by
Shubham Kumar
Committed by
Peter Leitzen
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolves rubocop offense Lint/RedundantSafeNavigation
parent
d2dc00ba
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
14 additions
and
24 deletions
+14
-24
.rubocop_todo.yml
.rubocop_todo.yml
+0
-15
app/controllers/concerns/labels_as_hash.rb
app/controllers/concerns/labels_as_hash.rb
+1
-1
app/policies/note_policy.rb
app/policies/note_policy.rb
+1
-1
app/services/users/update_canonical_email_service.rb
app/services/users/update_canonical_email_service.rb
+1
-1
changelogs/unreleased/pl-rubocop-todo-redundant-safe-navigation.yml
.../unreleased/pl-rubocop-todo-redundant-safe-navigation.yml
+5
-0
ee/app/presenters/iteration_presenter.rb
ee/app/presenters/iteration_presenter.rb
+2
-2
ee/app/services/ee/members/destroy_service.rb
ee/app/services/ee/members/destroy_service.rb
+1
-1
ee/lib/ee/gitlab/email/handler/reply_processing.rb
ee/lib/ee/gitlab/email/handler/reply_processing.rb
+1
-1
qa/qa/specs/helpers/quarantine.rb
qa/qa/specs/helpers/quarantine.rb
+1
-1
spec/controllers/boards/issues_controller_spec.rb
spec/controllers/boards/issues_controller_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
17deaaff
...
...
@@ -202,21 +202,6 @@ Lint/MixedRegexpCaptureTypes:
Lint/RedundantCopDisableDirective
:
Enabled
:
false
# Offense count: 9
# Cop supports --auto-correct.
# Configuration parameters: AllowedMethods.
# AllowedMethods: instance_of?, kind_of?, is_a?, eql?, respond_to?, equal?
Lint/RedundantSafeNavigation
:
Exclude
:
-
'
app/controllers/concerns/labels_as_hash.rb'
-
'
app/policies/note_policy.rb'
-
'
app/services/users/update_canonical_email_service.rb'
-
'
ee/app/presenters/iteration_presenter.rb'
-
'
ee/app/services/ee/members/destroy_service.rb'
-
'
ee/lib/ee/gitlab/email/handler/reply_processing.rb'
-
'
qa/qa/specs/helpers/quarantine.rb'
-
'
spec/controllers/boards/issues_controller_spec.rb'
# Offense count: 1
Lint/SelfAssignment
:
Exclude
:
...
...
app/controllers/concerns/labels_as_hash.rb
View file @
17deaaff
...
...
@@ -11,7 +11,7 @@ module LabelsAsHash
label_hashes
=
available_labels
.
as_json
(
only:
[
:title
,
:color
])
if
target
&
.
respond_to?
(
:labels
)
if
target
.
respond_to?
(
:labels
)
already_set_labels
=
available_labels
&
target
.
labels
if
already_set_labels
.
present?
titles
=
already_set_labels
.
map
(
&
:title
)
...
...
app/policies/note_policy.rb
View file @
17deaaff
...
...
@@ -76,7 +76,7 @@ class NotePolicy < BasePolicy
def
parent_namespace
strong_memoize
(
:parent_namespace
)
do
next
if
@subject
.
is_a?
(
PersonalSnippet
)
next
@subject
.
noteable
.
group
if
@subject
.
noteable
&
.
is_a?
(
Epic
)
next
@subject
.
noteable
.
group
if
@subject
.
noteable
.
is_a?
(
Epic
)
@subject
.
project
end
...
...
app/services/users/update_canonical_email_service.rb
View file @
17deaaff
...
...
@@ -7,7 +7,7 @@ module Users
INCLUDED_DOMAINS_PATTERN
=
[
/gmail.com/
].
freeze
def
initialize
(
user
:)
raise
ArgumentError
.
new
(
"Please provide a user"
)
unless
user
&
.
is_a?
(
User
)
raise
ArgumentError
.
new
(
"Please provide a user"
)
unless
user
.
is_a?
(
User
)
@user
=
user
end
...
...
changelogs/unreleased/pl-rubocop-todo-redundant-safe-navigation.yml
0 → 100644
View file @
17deaaff
---
title
:
Fixes offense Lint/RedundantSafeNavigation
merge_request
:
56884
author
:
Shubham Kumar (@imskr)
type
:
fixed
ee/app/presenters/iteration_presenter.rb
View file @
17deaaff
...
...
@@ -14,7 +14,7 @@ class IterationPresenter < Gitlab::View::Presenter::Delegated
def
scoped_iteration_path
(
parent
:)
parent_object
=
parent
[
:parent_object
]
||
iteration
.
resource_parent
if
parent_object
&
.
is_a?
(
Project
)
if
parent_object
.
is_a?
(
Project
)
project_iteration_path
(
parent_object
,
iteration
.
id
,
only_path:
true
)
else
group_iteration_path
(
parent_object
,
iteration
.
id
,
only_path:
true
)
...
...
@@ -24,7 +24,7 @@ class IterationPresenter < Gitlab::View::Presenter::Delegated
def
scoped_iteration_url
(
parent
:)
parent_object
=
parent
[
:parent_object
]
||
iteration
.
resource_parent
if
parent_object
&
.
is_a?
(
Project
)
if
parent_object
.
is_a?
(
Project
)
project_iteration_url
(
parent_object
,
iteration
.
id
)
else
group_iteration_url
(
parent_object
,
iteration
.
id
)
...
...
ee/app/services/ee/members/destroy_service.rb
View file @
17deaaff
...
...
@@ -13,7 +13,7 @@ module EE
end
cleanup_group_identity
(
member
)
cleanup_group_deletion_schedule
(
member
)
if
member
.
source
&
.
is_a?
(
Group
)
cleanup_group_deletion_schedule
(
member
)
if
member
.
source
.
is_a?
(
Group
)
end
private
...
...
ee/lib/ee/gitlab/email/handler/reply_processing.rb
View file @
17deaaff
...
...
@@ -11,7 +11,7 @@ module EE
override
:upload_params
def
upload_params
return
super
unless
try
(
:noteable
)
&
.
is_a?
(
Epic
)
return
super
unless
try
(
:noteable
).
is_a?
(
Epic
)
{
upload_parent:
noteable
.
group
,
...
...
qa/qa/specs/helpers/quarantine.rb
View file @
17deaaff
...
...
@@ -52,7 +52,7 @@ module QA
if
example
.
metadata
.
key?
(
:quarantine
)
quarantine_tag
=
example
.
metadata
[
:quarantine
]
if
quarantine_tag
&
.
is_a?
(
Hash
)
&&
quarantine_tag
&
.
key?
(
:only
)
if
quarantine_tag
.
is_a?
(
Hash
)
&&
quarantine_tag
&
.
key?
(
:only
)
# If the :quarantine hash contains :only, we respect that.
# For instance `quarantine: { only: { subdomain: :staging } }` will only quarantine the test when it runs against staging.
return
unless
Runtime
::
Env
.
context_matches?
(
quarantine_tag
[
:only
])
...
...
spec/controllers/boards/issues_controller_spec.rb
View file @
17deaaff
...
...
@@ -404,7 +404,7 @@ RSpec.describe Boards::IssuesController do
list_id:
list
.
try
(
:to_param
)
}
unless
board
.
try
(
:parent
)
&
.
is_a?
(
Group
)
unless
board
.
try
(
:parent
).
is_a?
(
Group
)
params
[
:namespace_id
]
=
project
.
namespace
.
to_param
params
[
:project_id
]
=
project
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