Enable even more frozen string in lib/gitlab
Enables frozens string for the following: * lib/gitlab/conflict/**/*.rb * lib/gitlab/cross_project_access/**/*.rb * lib/gitlab/cycle_analytics/**/*.rb * lib/gitlab/data_builder/**/*.rb * lib/gitlab/database/**/*.rb * lib/gitlab/dependency_linker/**/*.rb * lib/gitlab/diff/**/*.rb * lib/gitlab/downtime_check/**/*.rb * lib/gitlab/email/**/*.rb * lib/gitlab/etag_caching/**/*.rb Partially addresses gitlab-org/gitlab-ce#47424.
This commit is contained in:
parent
68cb1e2393
commit
7e6f6e1603
102 changed files with 214 additions and 5 deletions
5
changelogs/unreleased/frozen-string-lib-gitlab-more.yml
Normal file
5
changelogs/unreleased/frozen-string-lib-gitlab-more.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Enable even more frozen string in lib/gitlab/**/*.rb
|
||||||
|
merge_request:
|
||||||
|
author: gfyoung
|
||||||
|
type: performance
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Conflict
|
module Conflict
|
||||||
class File
|
class File
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Conflict
|
module Conflict
|
||||||
class FileCollection
|
class FileCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
class CrossProjectAccess
|
class CrossProjectAccess
|
||||||
class CheckCollection
|
class CheckCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
class CrossProjectAccess
|
class CrossProjectAccess
|
||||||
class CheckInfo
|
class CheckInfo
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
class CrossProjectAccess
|
class CrossProjectAccess
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class BaseEventFetcher
|
class BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module BaseQuery
|
module BaseQuery
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class BaseStage
|
class BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class CodeEventFetcher < BaseEventFetcher
|
class CodeEventFetcher < BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class CodeStage < BaseStage
|
class CodeStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module EventFetcher
|
module EventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class IssueEventFetcher < BaseEventFetcher
|
class IssueEventFetcher < BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class IssueStage < BaseStage
|
class IssueStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module MetricsTables
|
module MetricsTables
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class Permissions
|
class Permissions
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class PlanEventFetcher < BaseEventFetcher
|
class PlanEventFetcher < BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class PlanStage < BaseStage
|
class PlanStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class ProductionEventFetcher < IssueEventFetcher
|
class ProductionEventFetcher < IssueEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module ProductionHelper
|
module ProductionHelper
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class ProductionStage < BaseStage
|
class ProductionStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class ReviewEventFetcher < BaseEventFetcher
|
class ReviewEventFetcher < BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class ReviewStage < BaseStage
|
class ReviewStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module Stage
|
module Stage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class StageSummary
|
class StageSummary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class StagingEventFetcher < BaseEventFetcher
|
class StagingEventFetcher < BaseEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class StagingStage < BaseStage
|
class StagingStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module Summary
|
module Summary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module Summary
|
module Summary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module Summary
|
module Summary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
module Summary
|
module Summary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class TestEventFetcher < StagingEventFetcher
|
class TestEventFetcher < StagingEventFetcher
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class TestStage < BaseStage
|
class TestStage < BaseStage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class Updater
|
class Updater
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module CycleAnalytics
|
module CycleAnalytics
|
||||||
class UsageData
|
class UsageData
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module Build
|
module Build
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module Note
|
module Note
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module Pipeline
|
module Pipeline
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module Push
|
module Push
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module Repository
|
module Repository
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DataBuilder
|
module DataBuilder
|
||||||
module WikiPage
|
module WikiPage
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module ArelMethods
|
module ArelMethods
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# For large tables, PostgreSQL can take a long time to count rows due to MVCC.
|
# For large tables, PostgreSQL can take a long time to count rows due to MVCC.
|
||||||
# We can optimize this by using the reltuples count as described in https://wiki.postgresql.org/wiki/Slow_Counting.
|
# We can optimize this by using the reltuples count as described in https://wiki.postgresql.org/wiki/Slow_Counting.
|
||||||
module Gitlab
|
module Gitlab
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module DateTime
|
module DateTime
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
# Model that can be used for querying permissions of a SQL user.
|
# Model that can be used for querying permissions of a SQL user.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# https://www.periscopedata.com/blog/medians-in-sql.html
|
# https://www.periscopedata.com/blog/medians-in-sql.html
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module MigrationHelpers
|
module MigrationHelpers
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module MultiThreadedMigration
|
module MultiThreadedMigration
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
# Module that can be injected into a ActiveRecord::Relation to make it
|
# Module that can be injected into a ActiveRecord::Relation to make it
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# This module can be included in migrations to make it easier to rename paths
|
# This module can be included in migrations to make it easier to rename paths
|
||||||
# of `Namespace` & `Project` models certain paths would become `reserved`.
|
# of `Namespace` & `Project` models certain paths would become `reserved`.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module RenameReservedPathsMigration
|
module RenameReservedPathsMigration
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module RenameReservedPathsMigration
|
module RenameReservedPathsMigration
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module RenameReservedPathsMigration
|
module RenameReservedPathsMigration
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
module RenameReservedPathsMigration
|
module RenameReservedPathsMigration
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Database
|
module Database
|
||||||
BINARY_TYPE =
|
BINARY_TYPE =
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class BaseLinker
|
class BaseLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class CartfileLinker < MethodLinker
|
class CartfileLinker < MethodLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
module Cocoapods
|
module Cocoapods
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class ComposerJsonLinker < PackageJsonLinker
|
class ComposerJsonLinker < PackageJsonLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class GemfileLinker < MethodLinker
|
class GemfileLinker < MethodLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class GemspecLinker < MethodLinker
|
class GemspecLinker < MethodLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class GodepsJsonLinker < JsonLinker
|
class GodepsJsonLinker < JsonLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class JsonLinker < BaseLinker
|
class JsonLinker < BaseLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class MethodLinker < BaseLinker
|
class MethodLinker < BaseLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class PackageJsonLinker < JsonLinker
|
class PackageJsonLinker < JsonLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class PodfileLinker < GemfileLinker
|
class PodfileLinker < GemfileLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class PodspecJsonLinker < JsonLinker
|
class PodspecJsonLinker < JsonLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class PodspecLinker < MethodLinker
|
class PodspecLinker < MethodLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module DependencyLinker
|
module DependencyLinker
|
||||||
class RequirementsTxtLinker < BaseLinker
|
class RequirementsTxtLinker < BaseLinker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class DiffRefs
|
class DiffRefs
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class File
|
class File
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module FileCollection
|
module FileCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module FileCollection
|
module FileCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module FileCollection
|
module FileCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module FileCollection
|
module FileCollection
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module Formatters
|
module Formatters
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module Formatters
|
module Formatters
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
module Formatters
|
module Formatters
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class Highlight
|
class Highlight
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class ImagePoint
|
class ImagePoint
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class InlineDiff
|
class InlineDiff
|
||||||
|
@ -71,7 +73,7 @@ module Gitlab
|
||||||
def find_changed_line_pairs(lines)
|
def find_changed_line_pairs(lines)
|
||||||
# Prefixes of all diff lines, indicating their types
|
# Prefixes of all diff lines, indicating their types
|
||||||
# For example: `" - + -+ ---+++ --+ -++"`
|
# For example: `" - + -+ ---+++ --+ -++"`
|
||||||
line_prefixes = lines.each_with_object("") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ')
|
line_prefixes = lines.each_with_object(+"") { |line, s| s << (line[0] || ' ') }.gsub(/[^ +-]/, ' ')
|
||||||
|
|
||||||
changed_line_pairs = []
|
changed_line_pairs = []
|
||||||
line_prefixes.scan(LINE_PAIRS_PATTERN) do
|
line_prefixes.scan(LINE_PAIRS_PATTERN) do
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker
|
class InlineDiffMarkdownMarker < Gitlab::StringRangeMarker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class InlineDiffMarker < Gitlab::StringRangeMarker
|
class InlineDiffMarker < Gitlab::StringRangeMarker
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class Line
|
class Line
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# When provided a diff for a specific file, maps old line numbers to new line
|
# When provided a diff for a specific file, maps old line numbers to new line
|
||||||
# numbers and back, to find out where a specific line in a file was moved by the
|
# numbers and back, to find out where a specific line in a file was moved by the
|
||||||
# changes.
|
# changes.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class ParallelDiff
|
class ParallelDiff
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Diff
|
module Diff
|
||||||
class Parser
|
class Parser
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Defines a specific location, identified by paths line numbers and image coordinates,
|
# Defines a specific location, identified by paths line numbers and image coordinates,
|
||||||
# within a specific diff, identified by start, head and base commit ids.
|
# within a specific diff, identified by start, head and base commit ids.
|
||||||
module Gitlab
|
module Gitlab
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Finds the diff position in the new diff that corresponds to the same location
|
# Finds the diff position in the new diff that corresponds to the same location
|
||||||
# specified by the provided position in the old diff.
|
# specified by the provided position in the old diff.
|
||||||
module Gitlab
|
module Gitlab
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
class DowntimeCheck
|
class DowntimeCheck
|
||||||
class Message
|
class Message
|
||||||
|
@ -18,13 +20,13 @@ module Gitlab
|
||||||
def to_s
|
def to_s
|
||||||
label = offline ? OFFLINE : ONLINE
|
label = offline ? OFFLINE : ONLINE
|
||||||
|
|
||||||
message = "[#{label}]: #{path}"
|
message = ["[#{label}]: #{path}"]
|
||||||
|
|
||||||
if reason?
|
if reason?
|
||||||
message += ":\n\n#{reason}\n\n"
|
message << ":\n\n#{reason}\n\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
message
|
message.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def reason?
|
def reason?
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
class AttachmentUploader
|
class AttachmentUploader
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Hook
|
module Hook
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Hook
|
module Hook
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Hook
|
module Hook
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Hook
|
module Hook
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
class HTMLParser
|
class HTMLParser
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Message
|
module Message
|
||||||
|
@ -116,7 +118,7 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def subject
|
def subject
|
||||||
subject_text = '[Git]'
|
subject_text = ['[Git]']
|
||||||
subject_text << "[#{project.full_path}]"
|
subject_text << "[#{project.full_path}]"
|
||||||
subject_text << "[#{ref_name}]" if @action == :push
|
subject_text << "[#{ref_name}]" if @action == :push
|
||||||
subject_text << ' '
|
subject_text << ' '
|
||||||
|
@ -134,6 +136,8 @@ module Gitlab
|
||||||
subject_action[0] = subject_action[0].capitalize
|
subject_action[0] = subject_action[0].capitalize
|
||||||
subject_text << "#{subject_action} #{ref_type} #{ref_name}"
|
subject_text << "#{subject_action} #{ref_type} #{ref_name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
subject_text.join
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_dependency 'gitlab/email/handler'
|
require_dependency 'gitlab/email/handler'
|
||||||
|
|
||||||
# Inspired in great part by Discourse's Email::Receiver
|
# Inspired in great part by Discourse's Email::Receiver
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Inspired in great part by Discourse's Email::Receiver
|
# Inspired in great part by Discourse's Email::Receiver
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Email
|
module Email
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module EtagCaching
|
module EtagCaching
|
||||||
class Middleware
|
class Middleware
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue