Read about our upcoming Code of Conduct on this issue

Commit b7d8df50 authored by Douwe Maan's avatar Douwe Maan
Browse files

Enable Style/MutableConstant

parent ad222f96ec59
......@@ -2,7 +2,7 @@ class MigrateSubscriptionsProjectId < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Subscriptions will not work as expected until this migration is complete.'
DOWNTIME_REASON = 'Subscriptions will not work as expected until this migration is complete.'.freeze
def up
execute <<-EOF.strip_heredoc
......
......@@ -2,7 +2,7 @@ class AddUniqueIndexToSubscriptions < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'This migration requires downtime because it changes a column to not accept null values.'
DOWNTIME_REASON = 'This migration requires downtime because it changes a column to not accept null values.'.freeze
disable_ddl_transaction!
......
......@@ -10,7 +10,7 @@ class RenameRepositoryStorageColumn < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = 'Renaming the application_settings.repository_storage column'
DOWNTIME_REASON = 'Renaming the application_settings.repository_storage column'.freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -25,7 +25,7 @@ def repository
end
DOWNTIME = true
DOWNTIME_REASON = 'Existing workers will error until they are using a newer version of the code'
DOWNTIME_REASON = 'Existing workers will error until they are using a newer version of the code'.freeze
disable_ddl_transaction!
......
......@@ -5,7 +5,7 @@ class FillRoutesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'No new namespaces should be created during data copy'
DOWNTIME_REASON = 'No new namespaces should be created during data copy'.freeze
def up
execute <<-EOF
......
......@@ -5,7 +5,7 @@ class FillProjectsRoutesTable < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'No new projects should be created during data copy'
DOWNTIME_REASON = 'No new projects should be created during data copy'.freeze
def up
if Gitlab::Database.postgresql?
......
......@@ -2,7 +2,7 @@ class MigrateProjectStatistics < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Removes two columns from the projects table'
DOWNTIME_REASON = 'Removes two columns from the projects table'.freeze
def up
# convert repository_size in float (megabytes) to integer (bytes),
......
......@@ -2,7 +2,7 @@ class FixupEnvironmentNameUniqueness < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Renaming non-unique environments'
DOWNTIME_REASON = 'Renaming non-unique environments'.freeze
def up
environments = Arel::Table.new(:environments)
......
......@@ -4,7 +4,7 @@ class CreateEnvironmentNameUniqueIndex < ActiveRecord::Migration
disable_ddl_transaction!
DOWNTIME = true
DOWNTIME_REASON = 'Making a non-unique index into a unique index'
DOWNTIME_REASON = 'Making a non-unique index into a unique index'.freeze
def up
remove_index :environments, [:project_id, :name]
......
......@@ -5,7 +5,7 @@ class AddEnvironmentSlug < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Adding NOT NULL column environments.slug with dependent data'
DOWNTIME_REASON = 'Adding NOT NULL column environments.slug with dependent data'.freeze
# Used to generate random suffixes for the slug
LETTERS = 'a'..'z'
......
......@@ -5,7 +5,7 @@ class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = 'Adding a *unique* index to environments.slug'
DOWNTIME_REASON = 'Adding a *unique* index to environments.slug'.freeze
disable_ddl_transaction!
......
......@@ -9,7 +9,7 @@ class AddForeignKeysToTimelogs < ActiveRecord::Migration
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
DOWNTIME_REASON = ''
DOWNTIME_REASON = ''.freeze
# When using the methods "add_concurrent_index" or "add_column_with_default"
# you must disable the use of transactions as these methods can not run in an
......
......@@ -2,7 +2,7 @@ class RemoveInactiveJiraServiceProperties < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = true
DOWNTIME_REASON = "Removes all inactive jira_service properties"
DOWNTIME_REASON = "Removes all inactive jira_service properties".freeze
def up
execute("UPDATE services SET properties = '{}' WHERE services.type = 'JiraService' and services.active = false")
......
......@@ -37,7 +37,7 @@ class RenameReservedProjectNames < ActiveRecord::Migration
unsubscribes
update
users
wikis)
wikis).freeze
def up
queues = Array.new(THREAD_COUNT) { Queue.new }
......
......@@ -6,7 +6,7 @@ module API
module APIGuard
extend ActiveSupport::Concern
PRIVATE_TOKEN_HEADER = "HTTP_PRIVATE_TOKEN"
PRIVATE_TOKEN_HEADER = "HTTP_PRIVATE_TOKEN".freeze
PRIVATE_TOKEN_PARAM = :private_token
included do |base|
......
......@@ -3,7 +3,7 @@ class AwardEmoji < Grape::API
include PaginationParams
before { authenticate! }
AWARDABLES = %w[issue merge_request snippet]
AWARDABLES = %w[issue merge_request snippet].freeze
resource :projects do
AWARDABLES.each do |awardable_type|
......
......@@ -3,7 +3,7 @@ module Helpers
include Gitlab::Utils
include Helpers::Pagination
SUDO_HEADER = "HTTP_SUDO"
SUDO_HEADER = "HTTP_SUDO".freeze
SUDO_PARAM = :sudo
def declared_params(options = {})
......
......@@ -4,7 +4,7 @@ class Notes < Grape::API
before { authenticate! }
NOTEABLE_TYPES = [Issue, MergeRequest, Snippet]
NOTEABLE_TYPES = [Issue, MergeRequest, Snippet].freeze
params do
requires :id, type: String, desc: 'The ID of a project'
......
......@@ -7,7 +7,7 @@ class Todos < Grape::API
ISSUABLE_TYPES = {
'merge_requests' => ->(id) { find_merge_request_with_access(id) },
'issues' => ->(id) { find_project_issue(id) }
}
}.freeze
params do
requires :id, type: String, desc: 'The ID of a project'
......
......@@ -37,7 +37,7 @@ class AutolinkFilter < HTML::Pipeline::Filter
and contains(., '://')
and not(starts-with(., 'http'))
and not(starts-with(., 'ftp'))
])
]).freeze
def call
return doc if context[:autolink] == false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment