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
module Bitbucket
class Connection
DEFAULT_API_VERSION = '2.0'
DEFAULT_BASE_URI = 'https://api.bitbucket.org/'
DEFAULT_QUERY = {}
DEFAULT_API_VERSION = '2.0'.freeze
DEFAULT_BASE_URI = 'https://api.bitbucket.org/'.freeze
DEFAULT_QUERY = {}.freeze
attr_reader :expires_at, :expires_in, :refresh_token, :token
......
......@@ -13,7 +13,7 @@ module Ansi2html
5 => 'magenta',
6 => 'cyan',
7 => 'white', # not that this is gray in the dark (aka default) color table
}
}.freeze
STYLE_SWITCHES = {
bold: 0x01,
......@@ -21,7 +21,7 @@ module Ansi2html
underline: 0x04,
conceal: 0x08,
cross: 0x10,
}
}.freeze
def self.convert(ansi, state = nil)
Converter.new.convert(ansi, state)
......@@ -86,7 +86,7 @@ def on_109(s) set_bg_color(9, 'l') end
attr_accessor :offset, :n_open_tags, :fg_color, :bg_color, :style_mask
STATE_PARAMS = [:offset, :n_open_tags, :fg_color, :bg_color, :style_mask]
STATE_PARAMS = [:offset, :n_open_tags, :fg_color, :bg_color, :style_mask].freeze
def convert(raw, new_state)
reset_state
......
module Ci
module API
module Helpers
BUILD_TOKEN_HEADER = "HTTP_BUILD_TOKEN"
BUILD_TOKEN_HEADER = "HTTP_BUILD_TOKEN".freeze
BUILD_TOKEN_PARAM = :token
UPDATE_RUNNER_EVERY = 10 * 60
......
......@@ -5,7 +5,7 @@ module ContainerRegistry
class Client
attr_accessor :uri
MANIFEST_VERSION = 'application/vnd.docker.distribution.manifest.v2+json'
MANIFEST_VERSION = 'application/vnd.docker.distribution.manifest.v2+json'.freeze
# Taken from: FaradayMiddleware::FollowRedirects
REDIRECT_CODES = Set.new [301, 302, 303, 307]
......
......@@ -2,8 +2,8 @@ module Gitlab
module Auth
class MissingPersonalTokenError < StandardError; end
SCOPES = [:api, :read_user]
DEFAULT_SCOPES = [:api]
SCOPES = [:api, :read_user].freeze
DEFAULT_SCOPES = [:api].freeze
OPTIONAL_SCOPES = SCOPES - DEFAULT_SCOPES
class << self
......
......@@ -15,7 +15,7 @@ class Template < Badge::Template
canceled: '#9f9f9f',
skipped: '#9f9f9f',
unknown: '#9f9f9f'
}
}.freeze
def initialize(badge)
@entity = badge.entity
......
......@@ -13,7 +13,7 @@ class Template < Badge::Template
medium: '#dfb317',
low: '#e05d44',
unknown: '#9f9f9f'
}
}.freeze
def initialize(badge)
@entity = badge.entity
......
......@@ -9,7 +9,7 @@ class Artifacts < Node
include Validatable
include Attributable
ALLOWED_KEYS = %i[name untracked paths when expire_in]
ALLOWED_KEYS = %i[name untracked paths when expire_in].freeze
attributes ALLOWED_KEYS
......
......@@ -8,7 +8,7 @@ module Entry
class Cache < Node
include Configurable
ALLOWED_KEYS = %i[key untracked paths]
ALLOWED_KEYS = %i[key untracked paths].freeze
validations do
validates :config, allowed_keys: ALLOWED_KEYS
......
......@@ -8,7 +8,7 @@ module Entry
class Environment < Node
include Validatable
ALLOWED_KEYS = %i[name url action on_stop]
ALLOWED_KEYS = %i[name url action on_stop].freeze
validations do
validate do
......
......@@ -11,7 +11,7 @@ class Job < Node
ALLOWED_KEYS = %i[tags script only except type image services allow_failure
type stage when artifacts cache dependencies before_script
after_script variables environment coverage]
after_script variables environment coverage].freeze
validations do
validates :config, allowed_keys: ALLOWED_KEYS
......
......@@ -4,7 +4,7 @@ class InlineDiffMarker
MARKDOWN_SYMBOLS = {
addition: "+",
deletion: "-"
}
}.freeze
attr_accessor :raw_line, :rich_line
......
......@@ -3,8 +3,8 @@ class DowntimeCheck
class Message
attr_reader :path, :offline
OFFLINE = "\e[31moffline\e[0m"
ONLINE = "\e[32monline\e[0m"
OFFLINE = "\e[31moffline\e[0m".freeze
ONLINE = "\e[32monline\e[0m".freeze
# path - The file path of the migration.
# offline - When set to `true` the migration will require downtime.
......
......@@ -5,7 +5,7 @@
module Gitlab
module Email
module Handler
HANDLERS = [UnsubscribeHandler, CreateNoteHandler, CreateIssueHandler]
HANDLERS = [UnsubscribeHandler, CreateNoteHandler, CreateIssueHandler].freeze
def self.for(mail, mail_key)
HANDLERS.find do |klass|
......
......@@ -10,7 +10,7 @@ module Gitlab
# ExclusiveLease.
#
class ExclusiveLease
LUA_CANCEL_SCRIPT = <<-EOS
LUA_CANCEL_SCRIPT = <<-EOS.freeze
local key, uuid = KEYS[1], ARGV[1]
if redis.call("get", key) == uuid then
redis.call("del", key)
......
......@@ -14,7 +14,7 @@ module FileDetector
koding: '.koding.yml',
gitlab_ci: '.gitlab-ci.yml',
avatar: /\Alogo\.(png|jpg|gif)\z/
}
}.freeze
# Returns an Array of file types based on the given paths.
#
......
......@@ -10,10 +10,10 @@ class GitAccess
deploy_key_upload:
'This deploy key does not have write access to this project.',
no_repo: 'A repository for this project does not exist yet.'
}
}.freeze
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }
PUSH_COMMANDS = %w{ git-receive-pack }
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }.freeze
PUSH_COMMANDS = %w{ git-receive-pack }.freeze
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS
attr_reader :actor, :project, :protocol, :user_access, :authentication_abilities
......
......@@ -3,7 +3,7 @@ module ImportExport
extend self
# For every version update, the version history in import_export.md has to be kept up to date.
VERSION = '0.1.6'
VERSION = '0.1.6'.freeze
FILENAME_LIMIT = 50
def export_path(relative_path:)
......
......@@ -2,8 +2,8 @@ module Gitlab
module Metrics
# Rack middleware for tracking Rails and Grape requests.
class RackMiddleware
CONTROLLER_KEY = 'action_controller.instance'
ENDPOINT_KEY = 'api.endpoint'
CONTROLLER_KEY = 'action_controller.instance'.freeze
ENDPOINT_KEY = 'api.endpoint'.freeze
CONTENT_TYPES = {
'text/html' => :html,
'text/plain' => :txt,
......@@ -14,7 +14,7 @@ class RackMiddleware
'image/jpeg' => :jpeg,
'image/gif' => :gif,
'image/svg+xml' => :svg
}
}.freeze
def initialize(app)
@app = app
......
......@@ -5,7 +5,7 @@ module Subscribers
class ActionView < ActiveSupport::Subscriber
attach_to :action_view
SERIES = 'views'
SERIES = 'views'.freeze
def render_template(event)
track(event) if current_transaction
......
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