Enable frozen string for app/models/**/*.rb

Partially addresses #47424.
This commit is contained in:
gfyoung 2018-08-03 00:15:25 -07:00
parent 5b663ddf4c
commit 388cb319d5
79 changed files with 161 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationSetting
class Term < ActiveRecord::Base
include CacheMarkdownField

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class GroupBadge < Badge
belongs_to :group

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ProjectBadge < Badge
belongs_to :project

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module Auxiliary
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Balsamiq < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Base
PARTIAL_PATH_PREFIX = 'projects/blob/viewers'.freeze

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class BinarySTL < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Cartfile < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Changelog < Base
include Auxiliary

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module ClientSide
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class ComposerJson < DependencyManager
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Contributing < Base
include Auxiliary

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class DependencyManager < Base
include Auxiliary

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Download < Base
include Simple

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Empty < Base
include Simple

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Gemfile < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Gemspec < DependencyManager
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class GitlabCiYml < Base
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class GodepsJson < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Image < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class License < Base
include Auxiliary

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Markup < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Notebook < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class PackageJson < DependencyManager
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class PDF < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Podfile < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Podspec < DependencyManager
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class PodspecJson < Podspec
self.file_types = %i(podspec_json)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Readme < Base
include Auxiliary

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class RequirementsTxt < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module Rich
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class RouteMap < Base
include ServerSide

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module ServerSide
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module Simple
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Sketch < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
module Static
extend ActiveSupport::Concern

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class SVG < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Text < Base
include Simple

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class TextSTL < BinarySTL
self.binary = false

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class Video < Base
include Rich

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module BlobViewer
class YarnLock < DependencyManager
include Static

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class ArtifactBlob
include BlobLike

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Build < CommitStatus
prepend ArtifactMigratable

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
# The purpose of this class is to store Build related data that can be disposed.
# Data that should be persisted forever, should be stored with Ci::Build model.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
# The purpose of this class is to store Build related runner session.
# Data will be removed after transitioning from running to any state.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class BuildTraceChunk < ActiveRecord::Base
include FastDestroyAll

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
module BuildTraceChunks
class Database

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
module BuildTraceChunks
class Fog

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
module BuildTraceChunks
class Redis

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class BuildTraceSection < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class BuildTraceSectionName < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
##
# This domain model is a representation of a group of jobs that are related

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class GroupVariable < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class JobArtifact < ActiveRecord::Base
include AfterCommitQueue

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
# Currently this is artificial object, constructed dynamically
# We should migrate this object to actual database record in the future

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Pipeline < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class PipelineSchedule < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class PipelineScheduleVariable < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class PipelineVariable < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Runner < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class RunnerNamespace < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class RunnerProject < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Stage < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Trigger < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class TriggerRequest < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Ci
class Variable < ActiveRecord::Base
extend Gitlab::Ci::Model

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Applications
class Helm < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Applications
class Ingress < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Applications
class Jupyter < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Applications
class Prometheus < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Applications
class Runner < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
class Cluster < ActiveRecord::Base
include Presentable

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Concerns
module ApplicationCore

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Concerns
module ApplicationData

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Concerns
module ApplicationStatus

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Platforms
class Kubernetes < ActiveRecord::Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
class Project < ActiveRecord::Base
self.table_name = 'cluster_projects'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Clusters
module Providers
class Gcp < ActiveRecord::Base

View File

@ -0,0 +1,5 @@
---
title: Enable frozen string for app/models/**/*.rb
merge_request: 21001
author: gfyoung
type: performance