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
154e0bad
Commit
154e0bad
authored
Jul 02, 2021
by
Doug Stull
Committed by
Matthias Käppler
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve Style/ClassEqualityComparison exceptions
- rubocop cleanup
parent
08d0566f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
10 additions
and
32 deletions
+10
-32
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-5
.rubocop_todo.yml
.rubocop_todo.yml
+0
-17
app/finders/security/jobs_finder.rb
app/finders/security/jobs_finder.rb
+1
-1
app/services/projects/overwrite_project_service.rb
app/services/projects/overwrite_project_service.rb
+1
-1
app/uploaders/dependency_proxy/file_uploader.rb
app/uploaders/dependency_proxy/file_uploader.rb
+1
-1
ee/app/graphql/resolvers/vulnerabilities/issue_links_resolver.rb
...graphql/resolvers/vulnerabilities/issue_links_resolver.rb
+1
-1
lib/gitlab/background_migration/user_mentions/models/note.rb
lib/gitlab/background_migration/user_mentions/models/note.rb
+1
-1
lib/gitlab/diff/file.rb
lib/gitlab/diff/file.rb
+1
-1
lib/gitlab/git.rb
lib/gitlab/git.rb
+1
-1
lib/gitlab/import_export/relation_tree_restorer.rb
lib/gitlab/import_export/relation_tree_restorer.rb
+1
-1
spec/requests/api/services_spec.rb
spec/requests/api/services_spec.rb
+1
-1
spec/support/shared_examples/lib/gitlab/import_export/relation_factory_shared_examples.rb
.../gitlab/import_export/relation_factory_shared_examples.rb
+1
-1
No files found.
.rubocop_manual_todo.yml
View file @
154e0bad
...
...
@@ -2146,11 +2146,6 @@ Gitlab/NamespacedClass:
-
'
spec/tasks/gitlab/task_helpers_spec.rb'
-
'
spec/uploaders/object_storage_spec.rb'
Style/ClassEqualityComparison
:
Exclude
:
-
spec/lib/peek/views/active_record_spec.rb
-
ee/spec/lib/peek/views/active_record_spec.rb
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/207950
Cop/UserAdmin
:
Exclude
:
...
...
.rubocop_todo.yml
View file @
154e0bad
...
...
@@ -660,23 +660,6 @@ Style/BisectedAttrAccessor:
Style/CaseLikeIf
:
Enabled
:
false
# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: ==, equal?, eql?
Style/ClassEqualityComparison
:
Exclude
:
-
'
app/finders/security/jobs_finder.rb'
-
'
app/services/projects/overwrite_project_service.rb'
-
'
app/uploaders/dependency_proxy/file_uploader.rb'
-
'
ee/app/graphql/resolvers/vulnerabilities/issue_links_resolver.rb'
-
'
lib/gitlab/background_migration/user_mentions/models/note.rb'
-
'
lib/gitlab/diff/file.rb'
-
'
lib/gitlab/git.rb'
-
'
lib/gitlab/import_export/relation_tree_restorer.rb'
-
'
spec/requests/api/services_spec.rb'
-
'
spec/support/shared_examples/lib/gitlab/import_export/relation_factory_shared_examples.rb'
# Offense count: 13
Style/CombinableLoops
:
Exclude
:
...
...
app/finders/security/jobs_finder.rb
View file @
154e0bad
...
...
@@ -20,7 +20,7 @@ module Security
end
def
initialize
(
pipeline
:,
job_types:
[])
if
self
.
class
==
Security
::
JobsFinder
if
self
.
instance_of?
(
Security
::
JobsFinder
)
raise
NotImplementedError
,
'This is an abstract class, please instantiate its descendants'
end
...
...
app/services/projects/overwrite_project_service.rb
View file @
154e0bad
...
...
@@ -20,7 +20,7 @@ module Projects
rescue
Exception
=>
e
# rubocop:disable Lint/RescueException
attempt_restore_repositories
(
source_project
)
if
e
.
class
==
Exception
if
e
.
instance_of?
(
Exception
)
raise
StandardError
,
e
.
message
else
raise
...
...
app/uploaders/dependency_proxy/file_uploader.rb
View file @
154e0bad
...
...
@@ -24,7 +24,7 @@ class DependencyProxy::FileUploader < GitlabUploader
# so we must store the custom content type in object storage.
# This does not apply to DependencyProxy::Blob uploads.
def
set_content_type
(
file
)
return
unless
model
.
class
==
DependencyProxy
::
Manifest
return
unless
model
.
instance_of?
(
DependencyProxy
::
Manifest
)
file
.
content_type
=
model
.
content_type
end
...
...
ee/app/graphql/resolvers/vulnerabilities/issue_links_resolver.rb
View file @
154e0bad
...
...
@@ -35,7 +35,7 @@ module Resolvers
end
def
valid_link_type?
(
args
)
if
args
[
:link_type
].
class
==
String
if
args
[
:link_type
].
instance_of?
(
String
)
link_type
=
args
[
:link_type
].
downcase
link_types
=
::
Vulnerabilities
::
IssueLink
.
link_types
.
keys
...
...
lib/gitlab/background_migration/user_mentions/models/note.rb
View file @
154e0bad
...
...
@@ -21,7 +21,7 @@ module Gitlab
belongs_to
:project
,
class_name:
"::Gitlab::BackgroundMigration::UserMentions::Models::Project"
def
for_personal_snippet?
noteable
&&
noteable
.
class
.
name
==
'PersonalSnippet'
noteable
&&
noteable
.
instance_of?
(
PersonalSnippet
)
end
def
for_project_noteable?
...
...
lib/gitlab/diff/file.rb
View file @
154e0bad
...
...
@@ -449,7 +449,7 @@ module Gitlab
end
def
alternate_viewer_class
return
unless
viewer
.
class
==
DiffViewer
::
Renamed
return
unless
viewer
.
instance_of?
(
DiffViewer
::
Renamed
)
find_renderable_viewer_class
(
RICH_VIEWERS
)
||
(
DiffViewer
::
Text
if
text?
)
end
...
...
lib/gitlab/git.rb
View file @
154e0bad
...
...
@@ -80,7 +80,7 @@ module Gitlab
def
shas_eql?
(
sha1
,
sha2
)
return
true
if
sha1
.
nil?
&&
sha2
.
nil?
return
false
if
sha1
.
nil?
||
sha2
.
nil?
return
false
unless
sha1
.
class
==
sha2
.
class
return
false
unless
sha1
.
instance_of?
(
sha2
.
class
)
# If either of the shas is below the minimum length, we cannot be sure
# that they actually refer to the same commit because of hash collision.
...
...
lib/gitlab/import_export/relation_tree_restorer.rb
View file @
154e0bad
...
...
@@ -37,7 +37,7 @@ module Gitlab
ActiveRecord
::
Base
.
no_touching
do
update_params!
BulkInsertableAssociations
.
with_bulk_insert
(
enabled:
@importable
.
class
==
::
Project
)
do
BulkInsertableAssociations
.
with_bulk_insert
(
enabled:
@importable
.
instance_of?
(
::
Project
)
)
do
fix_ci_pipelines_not_sorted_on_legacy_project_json!
create_relations!
end
...
...
spec/requests/api/services_spec.rb
View file @
154e0bad
...
...
@@ -76,7 +76,7 @@ RSpec.describe API::Services do
required_attributes
=
service_attrs_list
.
select
do
|
attr
|
service_klass
.
validators_on
(
attr
).
any?
do
|
v
|
v
.
class
==
ActiveRecord
::
Validations
::
PresenceValidator
&&
v
.
instance_of?
(
ActiveRecord
::
Validations
::
PresenceValidator
)
&&
# exclude presence validators with conditional since those are not really required
!
[
:if
,
:unless
].
any?
{
|
cond
|
v
.
options
.
include?
(
cond
)
}
end
...
...
spec/support/shared_examples/lib/gitlab/import_export/relation_factory_shared_examples.rb
View file @
154e0bad
...
...
@@ -12,7 +12,7 @@ RSpec.shared_examples 'Notes user references' do
'id'
=>
111
,
'access_level'
=>
30
,
'source_id'
=>
1
,
'source_type'
=>
importable
.
class
.
name
==
'Project'
?
'Project'
:
'Namespace'
,
'source_type'
=>
importable
.
instance_of?
(
Project
)
?
'Project'
:
'Namespace'
,
'user_id'
=>
3
,
'notification_level'
=>
3
,
'created_at'
=>
'2016-11-18T09:29:42.634Z'
,
...
...
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