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
7def2a81
Commit
7def2a81
authored
Mar 21, 2021
by
Lee Tickett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary use of freeze
parent
75891f66
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
27 additions
and
22 deletions
+27
-22
changelogs/unreleased/31343-remove-unnecessary-use-of-freeze4.yml
...gs/unreleased/31343-remove-unnecessary-use-of-freeze4.yml
+5
-0
lib/gitlab/jira/dvcs.rb
lib/gitlab/jira/dvcs.rb
+2
-2
lib/gitlab/kubernetes/deployment.rb
lib/gitlab/kubernetes/deployment.rb
+1
-1
lib/gitlab/tracking/standard_context.rb
lib/gitlab/tracking/standard_context.rb
+2
-2
lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
+1
-1
qa/qa/runtime/api/request.rb
qa/qa/runtime/api/request.rb
+1
-1
qa/spec/support/helpers/stub_env.rb
qa/spec/support/helpers/stub_env.rb
+1
-1
rubocop/cop/gitlab/rails_logger.rb
rubocop/cop/gitlab/rails_logger.rb
+1
-1
rubocop/cop/graphql/json_type.rb
rubocop/cop/graphql/json_type.rb
+1
-1
rubocop/cop/include_sidekiq_worker.rb
rubocop/cop/include_sidekiq_worker.rb
+1
-1
rubocop/cop/lint/last_keyword_argument.rb
rubocop/cop/lint/last_keyword_argument.rb
+1
-1
rubocop/cop/migration/add_column_with_default.rb
rubocop/cop/migration/add_column_with_default.rb
+1
-1
rubocop/cop/migration/add_concurrent_foreign_key.rb
rubocop/cop/migration/add_concurrent_foreign_key.rb
+1
-1
rubocop/cop/migration/add_concurrent_index.rb
rubocop/cop/migration/add_concurrent_index.rb
+1
-1
rubocop/cop/migration/add_index.rb
rubocop/cop/migration/add_index.rb
+1
-1
rubocop/cop/migration/add_limit_to_text_columns.rb
rubocop/cop/migration/add_limit_to_text_columns.rb
+1
-1
rubocop/cop/migration/add_timestamps.rb
rubocop/cop/migration/add_timestamps.rb
+1
-1
rubocop/cop/migration/datetime.rb
rubocop/cop/migration/datetime.rb
+1
-1
rubocop/cop/project_path_helper.rb
rubocop/cop/project_path_helper.rb
+1
-1
rubocop/cop/safe_params.rb
rubocop/cop/safe_params.rb
+1
-1
rubocop/cop/sidekiq_options_queue.rb
rubocop/cop/sidekiq_options_queue.rb
+1
-1
No files found.
changelogs/unreleased/31343-remove-unnecessary-use-of-freeze4.yml
0 → 100644
View file @
7def2a81
---
title
:
Remove unnecessary use of freeze
merge_request
:
57059
author
:
Lee Tickett @leetickett
type
:
other
lib/gitlab/jira/dvcs.rb
View file @
7def2a81
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Jira
module
Jira
module
Dvcs
module
Dvcs
ENCODED_SLASH
=
'@'
.
freeze
ENCODED_SLASH
=
'@'
SLASH
=
'/'
.
freeze
SLASH
=
'/'
ENCODED_ROUTE_REGEX
=
/[a-zA-Z0-9_\-\.
#{
ENCODED_SLASH
}
]+/
.
freeze
ENCODED_ROUTE_REGEX
=
/[a-zA-Z0-9_\-\.
#{
ENCODED_SLASH
}
]+/
.
freeze
def
self
.
encode_slash
(
path
)
def
self
.
encode_slash
(
path
)
...
...
lib/gitlab/kubernetes/deployment.rb
View file @
7def2a81
...
@@ -5,7 +5,7 @@ module Gitlab
...
@@ -5,7 +5,7 @@ module Gitlab
class
Deployment
class
Deployment
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
STABLE_TRACK_VALUE
=
'stable'
.
freeze
STABLE_TRACK_VALUE
=
'stable'
def
initialize
(
attributes
=
{},
pods:
[])
def
initialize
(
attributes
=
{},
pods:
[])
@attributes
=
attributes
@attributes
=
attributes
...
...
lib/gitlab/tracking/standard_context.rb
View file @
7def2a81
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
module
Gitlab
module
Gitlab
module
Tracking
module
Tracking
class
StandardContext
class
StandardContext
GITLAB_STANDARD_SCHEMA_URL
=
'iglu:com.gitlab/gitlab_standard/jsonschema/1-0-3'
.
freeze
GITLAB_STANDARD_SCHEMA_URL
=
'iglu:com.gitlab/gitlab_standard/jsonschema/1-0-3'
GITLAB_RAILS_SOURCE
=
'gitlab-rails'
.
freeze
GITLAB_RAILS_SOURCE
=
'gitlab-rails'
def
initialize
(
namespace:
nil
,
project:
nil
,
user:
nil
,
**
data
)
def
initialize
(
namespace:
nil
,
project:
nil
,
user:
nil
,
**
data
)
@data
=
data
@data
=
data
...
...
lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
View file @
7def2a81
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
module
Gitlab::UsageDataCounters
module
Gitlab::UsageDataCounters
class
CiTemplateUniqueCounter
class
CiTemplateUniqueCounter
REDIS_SLOT
=
'ci_templates'
.
freeze
REDIS_SLOT
=
'ci_templates'
# NOTE: Events originating from implicit Auto DevOps pipelines get prefixed with `implicit_`
# NOTE: Events originating from implicit Auto DevOps pipelines get prefixed with `implicit_`
TEMPLATE_TO_EVENT
=
{
TEMPLATE_TO_EVENT
=
{
...
...
qa/qa/runtime/api/request.rb
View file @
7def2a81
...
@@ -4,7 +4,7 @@ module QA
...
@@ -4,7 +4,7 @@ module QA
module
Runtime
module
Runtime
module
API
module
API
class
Request
class
Request
API_VERSION
=
'v4'
.
freeze
API_VERSION
=
'v4'
def
initialize
(
api_client
,
path
,
**
query_string
)
def
initialize
(
api_client
,
path
,
**
query_string
)
query_string
[
:private_token
]
||=
api_client
.
personal_access_token
unless
query_string
[
:oauth_access_token
]
query_string
[
:private_token
]
||=
api_client
.
personal_access_token
unless
query_string
[
:oauth_access_token
]
...
...
qa/spec/support/helpers/stub_env.rb
View file @
7def2a81
...
@@ -15,7 +15,7 @@ module Helpers
...
@@ -15,7 +15,7 @@ module Helpers
private
private
STUBBED_KEY
=
'__STUBBED__'
.
freeze
STUBBED_KEY
=
'__STUBBED__'
def
add_stubbed_value
(
key
,
value
)
def
add_stubbed_value
(
key
,
value
)
allow
(
ENV
).
to
receive
(
:[]
).
with
(
key
).
and_return
(
value
)
allow
(
ENV
).
to
receive
(
:[]
).
with
(
key
).
and_return
(
value
)
...
...
rubocop/cop/gitlab/rails_logger.rb
View file @
7def2a81
...
@@ -21,7 +21,7 @@ module RuboCop
...
@@ -21,7 +21,7 @@ module RuboCop
# # OK
# # OK
# Rails.logger.level
# Rails.logger.level
MSG
=
'Use a structured JSON logger instead of `Rails.logger`. '
\
MSG
=
'Use a structured JSON logger instead of `Rails.logger`. '
\
'https://docs.gitlab.com/ee/development/logging.html'
.
freeze
'https://docs.gitlab.com/ee/development/logging.html'
# See supported log methods:
# See supported log methods:
# https://ruby-doc.org/stdlib-2.6.6/libdoc/logger/rdoc/Logger.html
# https://ruby-doc.org/stdlib-2.6.6/libdoc/logger/rdoc/Logger.html
...
...
rubocop/cop/graphql/json_type.rb
View file @
7def2a81
...
@@ -20,7 +20,7 @@ module RuboCop
...
@@ -20,7 +20,7 @@ module RuboCop
module
Graphql
module
Graphql
class
JSONType
<
RuboCop
::
Cop
::
Cop
class
JSONType
<
RuboCop
::
Cop
::
Cop
MSG
=
'Avoid using GraphQL::Types::JSON. See: '
\
MSG
=
'Avoid using GraphQL::Types::JSON. See: '
\
'https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#json'
.
freeze
'https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#json'
def_node_matcher
:has_json_type?
,
<<~
PATTERN
def_node_matcher
:has_json_type?
,
<<~
PATTERN
(send nil? {:field :argument}
(send nil? {:field :argument}
...
...
rubocop/cop/include_sidekiq_worker.rb
View file @
7def2a81
...
@@ -4,7 +4,7 @@ module RuboCop
...
@@ -4,7 +4,7 @@ module RuboCop
module
Cop
module
Cop
# Cop that makes sure workers include `ApplicationWorker`, not `Sidekiq::Worker`.
# Cop that makes sure workers include `ApplicationWorker`, not `Sidekiq::Worker`.
class
IncludeSidekiqWorker
<
RuboCop
::
Cop
::
Cop
class
IncludeSidekiqWorker
<
RuboCop
::
Cop
::
Cop
MSG
=
'Include `ApplicationWorker`, not `Sidekiq::Worker`.'
.
freeze
MSG
=
'Include `ApplicationWorker`, not `Sidekiq::Worker`.'
def_node_matcher
:includes_sidekiq_worker?
,
<<~
PATTERN
def_node_matcher
:includes_sidekiq_worker?
,
<<~
PATTERN
(send nil? :include (const (const nil? :Sidekiq) :Worker))
(send nil? :include (const (const nil? :Sidekiq) :Worker))
...
...
rubocop/cop/lint/last_keyword_argument.rb
View file @
7def2a81
...
@@ -10,7 +10,7 @@ module RuboCop
...
@@ -10,7 +10,7 @@ module RuboCop
# 1. Downloading the complete set of deprecations/ files from a CI
# 1. Downloading the complete set of deprecations/ files from a CI
# pipeline (see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47720)
# pipeline (see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47720)
class
LastKeywordArgument
<
Cop
class
LastKeywordArgument
<
Cop
MSG
=
'Using the last argument as keyword parameters is deprecated'
.
freeze
MSG
=
'Using the last argument as keyword parameters is deprecated'
DEPRECATIONS_GLOB
=
File
.
expand_path
(
'../../../deprecations/**/*.yml'
,
__dir__
)
DEPRECATIONS_GLOB
=
File
.
expand_path
(
'../../../deprecations/**/*.yml'
,
__dir__
)
KEYWORD_DEPRECATION_STR
=
'maybe ** should be added to the call'
KEYWORD_DEPRECATION_STR
=
'maybe ** should be added to the call'
...
...
rubocop/cop/migration/add_column_with_default.rb
View file @
7def2a81
...
@@ -8,7 +8,7 @@ module RuboCop
...
@@ -8,7 +8,7 @@ module RuboCop
class
AddColumnWithDefault
<
RuboCop
::
Cop
::
Cop
class
AddColumnWithDefault
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_column_with_default` is deprecated, use `add_column` instead'
.
freeze
MSG
=
'`add_column_with_default` is deprecated, use `add_column` instead'
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_concurrent_foreign_key.rb
View file @
7def2a81
...
@@ -10,7 +10,7 @@ module RuboCop
...
@@ -10,7 +10,7 @@ module RuboCop
class
AddConcurrentForeignKey
<
RuboCop
::
Cop
::
Cop
class
AddConcurrentForeignKey
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_foreign_key` requires downtime, use `add_concurrent_foreign_key` instead'
.
freeze
MSG
=
'`add_foreign_key` requires downtime, use `add_concurrent_foreign_key` instead'
def_node_matcher
:false_node?
,
<<~
PATTERN
def_node_matcher
:false_node?
,
<<~
PATTERN
(false)
(false)
...
...
rubocop/cop/migration/add_concurrent_index.rb
View file @
7def2a81
...
@@ -11,7 +11,7 @@ module RuboCop
...
@@ -11,7 +11,7 @@ module RuboCop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_concurrent_index` is not reversible so you must manually define '
\
MSG
=
'`add_concurrent_index` is not reversible so you must manually define '
\
'the `up` and `down` methods in your migration class, using `remove_concurrent_index` in `down`'
.
freeze
'the `up` and `down` methods in your migration class, using `remove_concurrent_index` in `down`'
def
on_send
(
node
)
def
on_send
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_index.rb
View file @
7def2a81
...
@@ -9,7 +9,7 @@ module RuboCop
...
@@ -9,7 +9,7 @@ module RuboCop
class
AddIndex
<
RuboCop
::
Cop
::
Cop
class
AddIndex
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'`add_index` requires downtime, use `add_concurrent_index` instead'
.
freeze
MSG
=
'`add_index` requires downtime, use `add_concurrent_index` instead'
def
on_def
(
node
)
def
on_def
(
node
)
return
unless
in_migration?
(
node
)
return
unless
in_migration?
(
node
)
...
...
rubocop/cop/migration/add_limit_to_text_columns.rb
View file @
7def2a81
...
@@ -14,7 +14,7 @@ module RuboCop
...
@@ -14,7 +14,7 @@ module RuboCop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'Text columns should always have a limit set (255 is suggested). '
\
MSG
=
'Text columns should always have a limit set (255 is suggested). '
\
'You can add a limit to a `text` column by using `add_text_limit`'
.
freeze
'You can add a limit to a `text` column by using `add_text_limit`'
def_node_matcher
:reverting?
,
<<~
PATTERN
def_node_matcher
:reverting?
,
<<~
PATTERN
(def :down ...)
(def :down ...)
...
...
rubocop/cop/migration/add_timestamps.rb
View file @
7def2a81
...
@@ -9,7 +9,7 @@ module RuboCop
...
@@ -9,7 +9,7 @@ module RuboCop
class
AddTimestamps
<
RuboCop
::
Cop
::
Cop
class
AddTimestamps
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'Do not use `add_timestamps`, use `add_timestamps_with_timezone` instead'
.
freeze
MSG
=
'Do not use `add_timestamps`, use `add_timestamps_with_timezone` instead'
# Check methods.
# Check methods.
def
on_send
(
node
)
def
on_send
(
node
)
...
...
rubocop/cop/migration/datetime.rb
View file @
7def2a81
...
@@ -9,7 +9,7 @@ module RuboCop
...
@@ -9,7 +9,7 @@ module RuboCop
class
Datetime
<
RuboCop
::
Cop
::
Cop
class
Datetime
<
RuboCop
::
Cop
::
Cop
include
MigrationHelpers
include
MigrationHelpers
MSG
=
'Do not use the `%s` data type, use `datetime_with_timezone` instead'
.
freeze
MSG
=
'Do not use the `%s` data type, use `datetime_with_timezone` instead'
# Check methods in table creation.
# Check methods in table creation.
def
on_def
(
node
)
def
on_def
(
node
)
...
...
rubocop/cop/project_path_helper.rb
View file @
7def2a81
...
@@ -5,7 +5,7 @@ module RuboCop
...
@@ -5,7 +5,7 @@ module RuboCop
class
ProjectPathHelper
<
RuboCop
::
Cop
::
Cop
class
ProjectPathHelper
<
RuboCop
::
Cop
::
Cop
MSG
=
'Use short project path helpers without explicitly passing the namespace: '
\
MSG
=
'Use short project path helpers without explicitly passing the namespace: '
\
'`foo_project_bar_path(project, bar)` instead of '
\
'`foo_project_bar_path(project, bar)` instead of '
\
'`foo_namespace_project_bar_path(project.namespace, project, bar)`.'
.
freeze
'`foo_namespace_project_bar_path(project.namespace, project, bar)`.'
METHOD_NAME_PATTERN
=
/\A([a-z_]+_)?namespace_project(?:_[a-z_]+)?_(?:url|path)\z/
.
freeze
METHOD_NAME_PATTERN
=
/\A([a-z_]+_)?namespace_project(?:_[a-z_]+)?_(?:url|path)\z/
.
freeze
...
...
rubocop/cop/safe_params.rb
View file @
7def2a81
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
module
RuboCop
module
RuboCop
module
Cop
module
Cop
class
SafeParams
<
RuboCop
::
Cop
::
Cop
class
SafeParams
<
RuboCop
::
Cop
::
Cop
MSG
=
'Use `safe_params` instead of `params` in url_for.'
.
freeze
MSG
=
'Use `safe_params` instead of `params` in url_for.'
METHOD_NAME_PATTERN
=
:url_for
METHOD_NAME_PATTERN
=
:url_for
UNSAFE_PARAM
=
:params
UNSAFE_PARAM
=
:params
...
...
rubocop/cop/sidekiq_options_queue.rb
View file @
7def2a81
...
@@ -4,7 +4,7 @@ module RuboCop
...
@@ -4,7 +4,7 @@ module RuboCop
module
Cop
module
Cop
# Cop that prevents manually setting a queue in Sidekiq workers.
# Cop that prevents manually setting a queue in Sidekiq workers.
class
SidekiqOptionsQueue
<
RuboCop
::
Cop
::
Cop
class
SidekiqOptionsQueue
<
RuboCop
::
Cop
::
Cop
MSG
=
'Do not manually set a queue; `ApplicationWorker` sets one automatically.'
.
freeze
MSG
=
'Do not manually set a queue; `ApplicationWorker` sets one automatically.'
def_node_matcher
:sidekiq_options?
,
<<~
PATTERN
def_node_matcher
:sidekiq_options?
,
<<~
PATTERN
(send nil? :sidekiq_options $...)
(send nil? :sidekiq_options $...)
...
...
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