Commit 3ff2e1bb authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'even-more-frozen-string-lib' into 'master'

Enable even more frozen string in lib/**/*.rb

See merge request gitlab-org/gitlab-ce!22206
parents 20168e48 c8755543
...@@ -50,7 +50,8 @@ Style/FrozenStringLiteralComment: ...@@ -50,7 +50,8 @@ Style/FrozenStringLiteralComment:
- 'danger/**/*' - 'danger/**/*'
- 'db/**/*' - 'db/**/*'
- 'ee/**/*' - 'ee/**/*'
- 'lib/**/*' - 'lib/gitlab/**/*'
- 'lib/tasks/**/*'
- 'qa/**/*' - 'qa/**/*'
- 'rubocop/**/*' - 'rubocop/**/*'
- 'scripts/**/*' - 'scripts/**/*'
......
---
title: Enable even more frozen string in lib/**/*.rb
merge_request:
author: gfyoung
type: performance
# frozen_string_literal: true
require 'rails/generators' require 'rails/generators'
module Rails module Rails
......
# frozen_string_literal: true
module Gitaly module Gitaly
class Server class Server
def self.all def self.all
......
# frozen_string_literal: true
module GoogleApi module GoogleApi
class Auth class Auth
attr_reader :access_token, :redirect_uri, :state attr_reader :access_token, :redirect_uri, :state
......
# frozen_string_literal: true
require 'google/apis/compute_v1' require 'google/apis/compute_v1'
require 'google/apis/container_v1' require 'google/apis/container_v1'
require 'google/apis/cloudbilling_v1' require 'google/apis/cloudbilling_v1'
......
unless Rails.env.production? # rubocop:disable Naming/FileName # rubocop:disable Naming/FileName
# frozen_string_literal: true
unless Rails.env.production?
require 'haml_lint/haml_visitor' require 'haml_lint/haml_visitor'
require 'haml_lint/linter' require 'haml_lint/linter'
require 'haml_lint/linter_registry' require 'haml_lint/linter_registry'
......
# frozen_string_literal: true
module JSONWebToken module JSONWebToken
class RSAToken < Token class RSAToken < Token
attr_reader :key_file attr_reader :key_file
......
# frozen_string_literal: true
module JSONWebToken module JSONWebToken
class Token class Token
attr_accessor :issuer, :subject, :audience, :id attr_accessor :issuer, :subject, :audience, :id
......
# frozen_string_literal: true
module Mattermost module Mattermost
ClientError = Class.new(Mattermost::Error) ClientError = Class.new(Mattermost::Error)
......
# frozen_string_literal: true
module Mattermost module Mattermost
class Command < Client class Command < Client
def create(params) def create(params)
......
# frozen_string_literal: true
module Mattermost module Mattermost
Error = Class.new(StandardError) Error = Class.new(StandardError)
end end
# frozen_string_literal: true
module Mattermost module Mattermost
class NoSessionError < Mattermost::Error class NoSessionError < Mattermost::Error
def message def message
......
# frozen_string_literal: true
module Mattermost module Mattermost
class Team < Client class Team < Client
# Returns all teams that the current user is a member of # Returns all teams that the current user is a member of
......
# frozen_string_literal: true
module MicrosoftTeams module MicrosoftTeams
class Activity class Activity
def initialize(title:, subtitle:, text:, image:) def initialize(title:, subtitle:, text:, image:)
......
# frozen_string_literal: true
module MicrosoftTeams module MicrosoftTeams
class Notifier class Notifier
def initialize(webhook) def initialize(webhook)
......
# frozen_string_literal: true
module ObjectStorage module ObjectStorage
# #
# The DirectUpload c;ass generates a set of presigned URLs # The DirectUpload c;ass generates a set of presigned URLs
......
# frozen_string_literal: true
require 'omniauth-oauth2' require 'omniauth-oauth2'
module OmniAuth module OmniAuth
......
# frozen_string_literal: true
require 'omniauth' require 'omniauth'
require 'jwt' require 'jwt'
......
# frozen_string_literal: true
module Peek module Peek
module Rblineprof module Rblineprof
module CustomControllerHelpers module CustomControllerHelpers
...@@ -41,7 +43,7 @@ module Peek ...@@ -41,7 +43,7 @@ module Peek
] ]
end.sort_by{ |a,b,c,d,e,f| -f } end.sort_by{ |a,b,c,d,e,f| -f }
output = "<div class='modal-dialog modal-xl'><div class='modal-content'>" output = ["<div class='modal-dialog modal-xl'><div class='modal-content'>"]
output << "<div class='modal-header'>" output << "<div class='modal-header'>"
output << "<h4>Line profiling: #{human_description(params[:lineprofiler])}</h4>" output << "<h4>Line profiling: #{human_description(params[:lineprofiler])}</h4>"
output << "<button class='close' type='button' data-dismiss='modal' aria-label='close'><span aria-hidden='true'>&times;</span></button>" output << "<button class='close' type='button' data-dismiss='modal' aria-label='close'><span aria-hidden='true'>&times;</span></button>"
...@@ -93,7 +95,7 @@ module Peek ...@@ -93,7 +95,7 @@ module Peek
output << "</div></div></div>" output << "</div></div></div>"
response.body += "<div class='modal' id='modal-peek-line-profile' tabindex=-1>#{output}</div>".html_safe response.body += "<div class='modal' id='modal-peek-line-profile' tabindex=-1>#{output.join}</div>".html_safe
end end
ret ret
......
# frozen_string_literal: true
module Peek module Peek
module Views module Views
class Gitaly < View class Gitaly < View
......
# frozen_string_literal: true
module Peek module Peek
module Views module Views
class Host < View class Host < View
......
# frozen_string_literal: true
module Rouge module Rouge
module Formatters module Formatters
class HTMLGitlab < Rouge::Formatters::HTML class HTMLGitlab < Rouge::Formatters::HTML
......
# frozen_string_literal: true
# A rouge plugin for CommonMark markdown engine. # A rouge plugin for CommonMark markdown engine.
# Used to highlight code generated by CommonMark. # Used to highlight code generated by CommonMark.
......
# frozen_string_literal: true
module RspecFlaky module RspecFlaky
class Config class Config
def self.generate_report? def self.generate_report?
......
# frozen_string_literal: true
module RspecFlaky module RspecFlaky
# This is a wrapper class for RSpec::Core::Example # This is a wrapper class for RSpec::Core::Example
class Example class Example
......
# frozen_string_literal: true
module RspecFlaky module RspecFlaky
# This represents a flaky RSpec example and is mainly meant to be saved in a JSON file # This represents a flaky RSpec example and is mainly meant to be saved in a JSON file
class FlakyExample < OpenStruct class FlakyExample < OpenStruct
......
# frozen_string_literal: true
require 'active_support/hash_with_indifferent_access' require 'active_support/hash_with_indifferent_access'
require_relative 'flaky_example' require_relative 'flaky_example'
......
# frozen_string_literal: true
require 'json' require 'json'
require_dependency 'rspec_flaky/config' require_dependency 'rspec_flaky/config'
......
# frozen_string_literal: true
require 'json' require 'json'
require 'time' require 'time'
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class ActiveUsersCheck < SystemCheck::BaseCheck class ActiveUsersCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class DatabaseConfigExistsCheck < SystemCheck::BaseCheck class DatabaseConfigExistsCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class GitConfigCheck < SystemCheck::BaseCheck class GitConfigCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class GitUserDefaultSSHConfigCheck < SystemCheck::BaseCheck class GitUserDefaultSSHConfigCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class GitVersionCheck < SystemCheck::BaseCheck class GitVersionCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class GitlabConfigExistsCheck < SystemCheck::BaseCheck class GitlabConfigExistsCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class GitlabConfigUpToDateCheck < SystemCheck::BaseCheck class GitlabConfigUpToDateCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class InitScriptExistsCheck < SystemCheck::BaseCheck class InitScriptExistsCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class InitScriptUpToDateCheck < SystemCheck::BaseCheck class InitScriptUpToDateCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class LogWritableCheck < SystemCheck::BaseCheck class LogWritableCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class MigrationsAreUpCheck < SystemCheck::BaseCheck class MigrationsAreUpCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class OrphanedGroupMembersCheck < SystemCheck::BaseCheck class OrphanedGroupMembersCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class ProjectsHaveNamespaceCheck < SystemCheck::BaseCheck class ProjectsHaveNamespaceCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class RedisVersionCheck < SystemCheck::BaseCheck class RedisVersionCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class RubyVersionCheck < SystemCheck::BaseCheck class RubyVersionCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class TmpWritableCheck < SystemCheck::BaseCheck class TmpWritableCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class UploadsDirectoryExistsCheck < SystemCheck::BaseCheck class UploadsDirectoryExistsCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class UploadsPathPermissionCheck < SystemCheck::BaseCheck class UploadsPathPermissionCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module App module App
class UploadsPathTmpPermissionCheck < SystemCheck::BaseCheck class UploadsPathTmpPermissionCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
# Base class for Checks. You must inherit from here # Base class for Checks. You must inherit from here
# and implement the methods below when necessary # and implement the methods below when necessary
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module Helpers module Helpers
include ::Gitlab::TaskHelpers include ::Gitlab::TaskHelpers
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module IncomingEmail module IncomingEmail
class ForemanConfiguredCheck < SystemCheck::BaseCheck class ForemanConfiguredCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module IncomingEmail module IncomingEmail
class ImapAuthenticationCheck < SystemCheck::BaseCheck class ImapAuthenticationCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module IncomingEmail module IncomingEmail
class InitdConfiguredCheck < SystemCheck::BaseCheck class InitdConfiguredCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module IncomingEmail module IncomingEmail
class MailRoomRunningCheck < SystemCheck::BaseCheck class MailRoomRunningCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module Orphans module Orphans
class NamespaceCheck < SystemCheck::BaseCheck class NamespaceCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
module Orphans module Orphans
class RepositoryCheck < SystemCheck::BaseCheck class RepositoryCheck < SystemCheck::BaseCheck
......
# frozen_string_literal: true
module SystemCheck module SystemCheck
# Simple Executor is current default executor for GitLab # Simple Executor is current default executor for GitLab
# It is a simple port from display logic in the old check.rake # It is a simple port from display logic in the old check.rake
......
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