Merge branch 'enable-frozen-string-lib-gitlab' into 'master'

Enable some frozen string in lib/gitlab

See merge request gitlab-org/gitlab-ce!22304
This commit is contained in:
Rémy Coutable 2018-10-15 08:22:16 +00:00
commit edb46ca644
54 changed files with 120 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
title: Enable some frozen string in lib/gitlab
merge_request:
author: gfyoung
type: performance

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
##

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# These calls help to authenticate to OAuth provider by providing username and password
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
class IpRateLimiter

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# LDAP authorization model
#
# * Check if we are allowed access (not blocked)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module LDAP

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Class to parse and transform the info provided by omniauth
#
module Gitlab

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# These calls help to authenticate to LDAP by providing username and password
#
# Since multiple LDAP servers are supported, it will loop through all of them

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Load a specific server configuration
module Gitlab
module Auth

View File

@ -1,4 +1,5 @@
# -*- ruby encoding: utf-8 -*-
# frozen_string_literal: true
# Based on the `ruby-net-ldap` gem's `Net::LDAP::DN`
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module LDAP

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module LDAP

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# LDAP extension for User model
#
# * Find or create user from omniauth.auth data

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Class to parse and transform the info provided by omniauth
#
module Gitlab

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# These calls help to authenticate to OAuth provider by providing username and password
#

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module OAuth

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module OAuth

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# :nocov:
module Gitlab
module Auth

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# OAuth extension for User model
#
# * Find GitLab user based on omniauth uid and provider

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
class OmniauthIdentityLinkerBase

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Use for authentication only, in particular for Rack::Attack.
# Does not perform authorization of scopes, etc.
module Gitlab

View File

@ -1,4 +1,7 @@
module Gitlab # rubocop:disable Naming/FileName
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module Gitlab
module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
def ci?(for_project)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module Saml

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module Saml

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
module Saml

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# SAML extension for User model
#
# * Find GitLab user based on SAML uid and provider

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
class TooManyIps < StandardError

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
class UniqueIpsLimiter

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
class UserAccessDeniedReason

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Auth
AuthenticationError = Class.new(StandardError)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
class Base

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Coverage

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Coverage

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Coverage

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
##

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Pipeline

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Pipeline

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
module Pipeline

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Badge
##

View File

@ -1,10 +1,15 @@
# frozen_string_literal: true
module Gitlab
module BareRepositoryImport
class Importer
NoAdminError = Class.new(StandardError)
def self.execute(import_path)
import_path << '/' unless import_path.ends_with?('/')
unless import_path.ends_with?('/')
import_path = "#{import_path}/"
end
repos_to_import = Dir.glob(import_path + '**/*.git')
unless user = User.admins.order_id_asc.first

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module BareRepositoryImport
class Repository
@ -6,9 +8,12 @@ module Gitlab
attr_reader :group_path, :project_name, :repo_path
def initialize(root_path, repo_path)
unless root_path.ends_with?('/')
root_path = "#{root_path}/"
end
@root_path = root_path
@repo_path = repo_path
@root_path << '/' unless root_path.ends_with?('/')
full_path =
if hashed? && !wiki?

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module BitbucketImport
class Importer

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module BitbucketImport
class ProjectCreator

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module BitbucketServerImport
class ProjectCreator

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# This class is not backed by a table in the main database.
# It loads the latest Pipeline for the HEAD of a repository, and caches that
# in Redis.

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Cache
# See https://docs.gitlab.com/ee/development/utilities.html#requestcache

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ChangeAccess

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class CommitCheck

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ForcePush

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class LfsIntegrity

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class MatchingMergeRequest

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class PostPushMessage

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ProjectCreated < PostPushMessage

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ProjectMoved < PostPushMessage