Commit 4962bee8 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'frozen-string-app-controllers-much-more' into 'master'

Enable even more frozen string in app/controllers

See merge request gitlab-org/gitlab-ce!21919
parents f1b44437 12ee2753
# frozen_string_literal: true
module InvalidUTF8ErrorHandler module InvalidUTF8ErrorHandler
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
# frozen_string_literal: true
class Projects::ApplicationController < ApplicationController class Projects::ApplicationController < ApplicationController
include CookiesHelper include CookiesHelper
include RoutableActions include RoutableActions
......
# frozen_string_literal: true
class Projects::ArtifactsController < Projects::ApplicationController class Projects::ArtifactsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
include RendersBlob include RendersBlob
......
# frozen_string_literal: true
class Projects::AutocompleteSourcesController < Projects::ApplicationController class Projects::AutocompleteSourcesController < Projects::ApplicationController
before_action :load_autocomplete_service, except: [:members] before_action :load_autocomplete_service, except: [:members]
......
# frozen_string_literal: true
class Projects::AvatarsController < Projects::ApplicationController class Projects::AvatarsController < Projects::ApplicationController
include SendsBlob include SendsBlob
......
# frozen_string_literal: true
class Projects::BadgesController < Projects::ApplicationController class Projects::BadgesController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
before_action :authorize_admin_project!, only: [:index] before_action :authorize_admin_project!, only: [:index]
......
# frozen_string_literal: true
# Controller for viewing a file's blame # Controller for viewing a file's blame
class Projects::BlameController < Projects::ApplicationController class Projects::BlameController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
# Controller for viewing a file's blame # Controller for viewing a file's blame
class Projects::BlobController < Projects::ApplicationController class Projects::BlobController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::BoardsController < Projects::ApplicationController class Projects::BoardsController < Projects::ApplicationController
include BoardsResponses include BoardsResponses
include IssuableCollections include IssuableCollections
......
# frozen_string_literal: true
class Projects::BranchesController < Projects::ApplicationController class Projects::BranchesController < Projects::ApplicationController
include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::SanitizeHelper
include SortingHelper include SortingHelper
......
# frozen_string_literal: true
class Projects::BuildArtifactsController < Projects::ApplicationController class Projects::BuildArtifactsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
include RendersBlob include RendersBlob
......
# frozen_string_literal: true
class Projects::BuildsController < Projects::ApplicationController class Projects::BuildsController < Projects::ApplicationController
before_action :authorize_read_build! before_action :authorize_read_build!
......
# frozen_string_literal: true
class Projects::Ci::LintsController < Projects::ApplicationController class Projects::Ci::LintsController < Projects::ApplicationController
before_action :authorize_create_pipeline! before_action :authorize_create_pipeline!
......
# frozen_string_literal: true
class Projects::Clusters::ApplicationsController < Projects::ApplicationController class Projects::Clusters::ApplicationsController < Projects::ApplicationController
before_action :cluster before_action :cluster
before_action :application_class, only: [:create] before_action :application_class, only: [:create]
......
# frozen_string_literal: true
class Projects::ClustersController < Projects::ApplicationController class Projects::ClustersController < Projects::ApplicationController
before_action :cluster, except: [:index, :new, :create_gcp, :create_user] before_action :cluster, except: [:index, :new, :create_gcp, :create_user]
before_action :authorize_read_cluster! before_action :authorize_read_cluster!
......
# frozen_string_literal: true
# Controller for a specific Commit # Controller for a specific Commit
# #
# Not to be confused with CommitsController, plural. # Not to be confused with CommitsController, plural.
......
# frozen_string_literal: true
require "base64" require "base64"
class Projects::CommitsController < Projects::ApplicationController class Projects::CommitsController < Projects::ApplicationController
......
# frozen_string_literal: true
require 'addressable/uri' require 'addressable/uri'
class Projects::CompareController < Projects::ApplicationController class Projects::CompareController < Projects::ApplicationController
......
# frozen_string_literal: true
module Projects module Projects
module CycleAnalytics module CycleAnalytics
class EventsController < Projects::ApplicationController class EventsController < Projects::ApplicationController
......
# frozen_string_literal: true
class Projects::CycleAnalyticsController < Projects::ApplicationController class Projects::CycleAnalyticsController < Projects::ApplicationController
include ActionView::Helpers::DateHelper include ActionView::Helpers::DateHelper
include ActionView::Helpers::TextHelper include ActionView::Helpers::TextHelper
......
# frozen_string_literal: true
class Projects::DeployKeysController < Projects::ApplicationController class Projects::DeployKeysController < Projects::ApplicationController
include RepositorySettingsRedirect include RepositorySettingsRedirect
respond_to :html respond_to :html
......
# frozen_string_literal: true
class Projects::DeployTokensController < Projects::ApplicationController class Projects::DeployTokensController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
......
# frozen_string_literal: true
class Projects::DeploymentsController < Projects::ApplicationController class Projects::DeploymentsController < Projects::ApplicationController
before_action :authorize_read_environment! before_action :authorize_read_environment!
before_action :authorize_read_deployment! before_action :authorize_read_deployment!
......
# frozen_string_literal: true
class Projects::DiscussionsController < Projects::ApplicationController class Projects::DiscussionsController < Projects::ApplicationController
include NotesHelper include NotesHelper
include RendersNotes include RendersNotes
......
# frozen_string_literal: true
class Projects::EnvironmentsController < Projects::ApplicationController class Projects::EnvironmentsController < Projects::ApplicationController
layout 'project' layout 'project'
before_action :authorize_read_environment! before_action :authorize_read_environment!
......
# frozen_string_literal: true
# Controller for viewing a repository's file structure # Controller for viewing a repository's file structure
class Projects::FindFileController < Projects::ApplicationController class Projects::FindFileController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::ForksController < Projects::ApplicationController class Projects::ForksController < Projects::ApplicationController
include ContinueParams include ContinueParams
......
# frozen_string_literal: true
# This file should be identical in GitLab Community Edition and Enterprise Edition # This file should be identical in GitLab Community Edition and Enterprise Edition
class Projects::GitHttpClientController < Projects::ApplicationController class Projects::GitHttpClientController < Projects::ApplicationController
......
# frozen_string_literal: true
class Projects::GitHttpController < Projects::GitHttpClientController class Projects::GitHttpController < Projects::GitHttpClientController
include WorkhorseRequest include WorkhorseRequest
......
# frozen_string_literal: true
class Projects::GraphsController < Projects::ApplicationController class Projects::GraphsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::GroupLinksController < Projects::ApplicationController class Projects::GroupLinksController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
before_action :authorize_admin_project! before_action :authorize_admin_project!
......
# frozen_string_literal: true
class Projects::HookLogsController < Projects::ApplicationController class Projects::HookLogsController < Projects::ApplicationController
include HooksExecution include HooksExecution
......
# frozen_string_literal: true
class Projects::HooksController < Projects::ApplicationController class Projects::HooksController < Projects::ApplicationController
include HooksExecution include HooksExecution
......
# frozen_string_literal: true
class Projects::ImportsController < Projects::ApplicationController class Projects::ImportsController < Projects::ApplicationController
include ContinueParams include ContinueParams
......
# frozen_string_literal: true
class Projects::IssuesController < Projects::ApplicationController class Projects::IssuesController < Projects::ApplicationController
include RendersNotes include RendersNotes
include ToggleSubscriptionAction include ToggleSubscriptionAction
......
# frozen_string_literal: true
class Projects::JobsController < Projects::ApplicationController class Projects::JobsController < Projects::ApplicationController
include SendFileUpload include SendFileUpload
......
# frozen_string_literal: true
class Projects::LabelsController < Projects::ApplicationController class Projects::LabelsController < Projects::ApplicationController
include ToggleSubscriptionAction include ToggleSubscriptionAction
...@@ -138,12 +140,7 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -138,12 +140,7 @@ class Projects::LabelsController < Projects::ApplicationController
end end
def flash_notice_for(label, group) def flash_notice_for(label, group)
notice = ''.html_safe ''.html_safe + "#{label.title} promoted to " + view_context.link_to('<u>group label</u>'.html_safe, group_labels_path(group)) + '.'
notice << label.title
notice << ' promoted to '
notice << view_context.link_to('<u>group label</u>'.html_safe, group_labels_path(group))
notice << '.'
notice
end end
protected protected
......
# frozen_string_literal: true
class Projects::LfsApiController < Projects::GitHttpClientController class Projects::LfsApiController < Projects::GitHttpClientController
include LfsRequest include LfsRequest
......
# frozen_string_literal: true
class Projects::LfsLocksApiController < Projects::GitHttpClientController class Projects::LfsLocksApiController < Projects::GitHttpClientController
include LfsRequest include LfsRequest
......
# frozen_string_literal: true
class Projects::LfsStorageController < Projects::GitHttpClientController class Projects::LfsStorageController < Projects::GitHttpClientController
include LfsRequest include LfsRequest
include WorkhorseRequest include WorkhorseRequest
......
# frozen_string_literal: true
class Projects::MattermostsController < Projects::ApplicationController class Projects::MattermostsController < Projects::ApplicationController
include TriggersHelper include TriggersHelper
include ActionView::Helpers::AssetUrlHelper include ActionView::Helpers::AssetUrlHelper
......
# frozen_string_literal: true
class Projects::MergeRequests::ApplicationController < Projects::ApplicationController class Projects::MergeRequests::ApplicationController < Projects::ApplicationController
before_action :check_merge_requests_available! before_action :check_merge_requests_available!
before_action :merge_request before_action :merge_request
......
# frozen_string_literal: true
class Projects::MergeRequests::ConflictsController < Projects::MergeRequests::ApplicationController class Projects::MergeRequests::ConflictsController < Projects::MergeRequests::ApplicationController
include IssuableActions include IssuableActions
......
# frozen_string_literal: true
class Projects::MergeRequests::CreationsController < Projects::MergeRequests::ApplicationController class Projects::MergeRequests::CreationsController < Projects::MergeRequests::ApplicationController
include DiffForPath include DiffForPath
include DiffHelper include DiffHelper
......
# frozen_string_literal: true
class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController
include DiffForPath include DiffForPath
include DiffHelper include DiffHelper
......
# frozen_string_literal: true
class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationController class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationController
include ToggleSubscriptionAction include ToggleSubscriptionAction
include IssuableActions include IssuableActions
......
# frozen_string_literal: true
class Projects::MilestonesController < Projects::ApplicationController class Projects::MilestonesController < Projects::ApplicationController
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include MilestoneActions include MilestoneActions
...@@ -91,12 +93,7 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -91,12 +93,7 @@ class Projects::MilestonesController < Projects::ApplicationController
end end
def flash_notice_for(milestone, group) def flash_notice_for(milestone, group)
notice = ''.html_safe ''.html_safe + "#{milestone.title} promoted to " + view_context.link_to('<u>group milestone</u>'.html_safe, group_milestone_path(group, milestone.iid)) + '.'
notice << milestone.title
notice << ' promoted to '
notice << view_context.link_to('<u>group milestone</u>'.html_safe, group_milestone_path(group, milestone.iid))
notice << '.'
notice
end end
def destroy def destroy
......
# frozen_string_literal: true
class Projects::MirrorsController < Projects::ApplicationController class Projects::MirrorsController < Projects::ApplicationController
include RepositorySettingsRedirect include RepositorySettingsRedirect
......
# frozen_string_literal: true
class Projects::NetworkController < Projects::ApplicationController class Projects::NetworkController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
include ApplicationHelper include ApplicationHelper
......
# frozen_string_literal: true
class Projects::NotesController < Projects::ApplicationController class Projects::NotesController < Projects::ApplicationController
include RendersNotes include RendersNotes
include NotesActions include NotesActions
......
# frozen_string_literal: true
class Projects::PagesController < Projects::ApplicationController class Projects::PagesController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
......
# frozen_string_literal: true
class Projects::PagesDomainsController < Projects::ApplicationController class Projects::PagesDomainsController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
......
# frozen_string_literal: true
class Projects::PipelineSchedulesController < Projects::ApplicationController class Projects::PipelineSchedulesController < Projects::ApplicationController
before_action :schedule, except: [:index, :new, :create] before_action :schedule, except: [:index, :new, :create]
......
# frozen_string_literal: true
class Projects::PipelinesController < Projects::ApplicationController class Projects::PipelinesController < Projects::ApplicationController
before_action :whitelist_query_limiting, only: [:create, :retry] before_action :whitelist_query_limiting, only: [:create, :retry]
before_action :pipeline, except: [:index, :new, :create, :charts] before_action :pipeline, except: [:index, :new, :create, :charts]
......
# frozen_string_literal: true
class Projects::PipelinesSettingsController < Projects::ApplicationController class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action :authorize_admin_pipeline! before_action :authorize_admin_pipeline!
......
# frozen_string_literal: true
class Projects::ProjectMembersController < Projects::ApplicationController class Projects::ProjectMembersController < Projects::ApplicationController
include MembershipActions include MembershipActions
include MembersPresentation include MembersPresentation
......
# frozen_string_literal: true
module Projects module Projects
module Prometheus module Prometheus
class MetricsController < Projects::ApplicationController class MetricsController < Projects::ApplicationController
......
# frozen_string_literal: true
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
protected protected
......
# frozen_string_literal: true
class Projects::ProtectedRefsController < Projects::ApplicationController class Projects::ProtectedRefsController < Projects::ApplicationController
include RepositorySettingsRedirect include RepositorySettingsRedirect
......
# frozen_string_literal: true
class Projects::ProtectedTagsController < Projects::ProtectedRefsController class Projects::ProtectedTagsController < Projects::ProtectedRefsController
protected protected
......
# frozen_string_literal: true
# Controller for viewing a file's raw # Controller for viewing a file's raw
class Projects::RawController < Projects::ApplicationController class Projects::RawController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::RefsController < Projects::ApplicationController class Projects::RefsController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
include TreeHelper include TreeHelper
......
# frozen_string_literal: true
module Projects module Projects
module Registry module Registry
class ApplicationController < Projects::ApplicationController class ApplicationController < Projects::ApplicationController
......
# frozen_string_literal: true
module Projects module Projects
module Registry module Registry
class RepositoriesController < ::Projects::Registry::ApplicationController class RepositoriesController < ::Projects::Registry::ApplicationController
......
# frozen_string_literal: true
module Projects module Projects
module Registry module Registry
class TagsController < ::Projects::Registry::ApplicationController class TagsController < ::Projects::Registry::ApplicationController
......
# frozen_string_literal: true
class Projects::ReleasesController < Projects::ApplicationController class Projects::ReleasesController < Projects::ApplicationController
# Authorize # Authorize
before_action :require_non_empty_project before_action :require_non_empty_project
......
# frozen_string_literal: true
class Projects::RepositoriesController < Projects::ApplicationController class Projects::RepositoriesController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::RunnerProjectsController < Projects::ApplicationController class Projects::RunnerProjectsController < Projects::ApplicationController
before_action :authorize_admin_build! before_action :authorize_admin_build!
......
# frozen_string_literal: true
class Projects::RunnersController < Projects::ApplicationController class Projects::RunnersController < Projects::ApplicationController
before_action :authorize_admin_build! before_action :authorize_admin_build!
before_action :runner, only: [:edit, :update, :destroy, :pause, :resume, :show] before_action :runner, only: [:edit, :update, :destroy, :pause, :resume, :show]
......
# frozen_string_literal: true
class Projects::ServicesController < Projects::ApplicationController class Projects::ServicesController < Projects::ApplicationController
include ServiceParams include ServiceParams
......
# frozen_string_literal: true
module Projects module Projects
module Settings module Settings
class CiCdController < Projects::ApplicationController class CiCdController < Projects::ApplicationController
......
# frozen_string_literal: true
module Projects module Projects
module Settings module Settings
class IntegrationsController < Projects::ApplicationController class IntegrationsController < Projects::ApplicationController
......
# frozen_string_literal: true
module Projects module Projects
module Settings module Settings
class RepositoryController < Projects::ApplicationController class RepositoryController < Projects::ApplicationController
......
# frozen_string_literal: true
class Projects::SnippetsController < Projects::ApplicationController class Projects::SnippetsController < Projects::ApplicationController
include RendersNotes include RendersNotes
include ToggleAwardEmoji include ToggleAwardEmoji
......
# frozen_string_literal: true
class Projects::TagsController < Projects::ApplicationController class Projects::TagsController < Projects::ApplicationController
include SortingHelper include SortingHelper
......
# frozen_string_literal: true
class Projects::TemplatesController < Projects::ApplicationController class Projects::TemplatesController < Projects::ApplicationController
before_action :authenticate_user!, :get_template_class before_action :authenticate_user!, :get_template_class
......
# frozen_string_literal: true
class Projects::TodosController < Projects::ApplicationController class Projects::TodosController < Projects::ApplicationController
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include TodosActions include TodosActions
......
# frozen_string_literal: true
# Controller for viewing a repository's file structure # Controller for viewing a repository's file structure
class Projects::TreeController < Projects::ApplicationController class Projects::TreeController < Projects::ApplicationController
include ExtractsPath include ExtractsPath
......
# frozen_string_literal: true
class Projects::TriggersController < Projects::ApplicationController class Projects::TriggersController < Projects::ApplicationController
before_action :authorize_admin_build! before_action :authorize_admin_build!
before_action :authorize_manage_trigger!, except: [:index, :create] before_action :authorize_manage_trigger!, except: [:index, :create]
......
# frozen_string_literal: true
class Projects::UploadsController < Projects::ApplicationController class Projects::UploadsController < Projects::ApplicationController
include UploadsActions include UploadsActions
include WorkhorseRequest include WorkhorseRequest
......
# frozen_string_literal: true
class Projects::VariablesController < Projects::ApplicationController class Projects::VariablesController < Projects::ApplicationController
before_action :authorize_admin_build! before_action :authorize_admin_build!
......
# frozen_string_literal: true
class Projects::WikisController < Projects::ApplicationController class Projects::WikisController < Projects::ApplicationController
include PreviewMarkdown include PreviewMarkdown
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module Sherlock module Sherlock
class ApplicationController < ::ApplicationController class ApplicationController < ::ApplicationController
before_action :find_transaction before_action :find_transaction
......
# frozen_string_literal: true
module Sherlock module Sherlock
class FileSamplesController < Sherlock::ApplicationController class FileSamplesController < Sherlock::ApplicationController
def show def show
......
# frozen_string_literal: true
module Sherlock module Sherlock
class QueriesController < Sherlock::ApplicationController class QueriesController < Sherlock::ApplicationController
def show def show
......
# frozen_string_literal: true
module Sherlock module Sherlock
class TransactionsController < Sherlock::ApplicationController class TransactionsController < Sherlock::ApplicationController
def index def index
......
# frozen_string_literal: true
class Snippets::NotesController < ApplicationController class Snippets::NotesController < ApplicationController
include NotesActions include NotesActions
include ToggleAwardEmoji include ToggleAwardEmoji
......
# frozen_string_literal: true
module Users module Users
class TermsController < ApplicationController class TermsController < ApplicationController
include InternalRedirect include InternalRedirect
......
---
title: Enable even more frozen string in app/controllers
merge_request:
author: gfyoung
type: performance
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