Commit 73322a0e authored by gfyoung's avatar gfyoung

Enable frozen string in app/controllers/**/*.rb

Enables frozen string for the following:

* app/controllers/*.rb
* app/controllers/admin/**/*.rb
* app/controllers/boards/**/*.rb
* app/controllers/ci/**/*.rb
* app/controllers/concerns/**/*.rb

Partially addresses #47424.
parent 2dac058d
# frozen_string_literal: true
class AbuseReportsController < ApplicationController
before_action :set_user, only: [:new]
......
# frozen_string_literal: true
class Admin::AbuseReportsController < Admin::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def index
......
# frozen_string_literal: true
class Admin::AppearancesController < Admin::ApplicationController
before_action :set_appearance, except: :create
......
# frozen_string_literal: true
# Provides a base class for Admin controllers to subclass
#
# Automatically sets the layout and ensures an administrator is logged in
......
# frozen_string_literal: true
class Admin::ApplicationSettingsController < Admin::ApplicationController
before_action :set_application_setting
......
# frozen_string_literal: true
class Admin::ApplicationsController < Admin::ApplicationController
include OauthApplications
......
# frozen_string_literal: true
class Admin::BackgroundJobsController < Admin::ApplicationController
def show
ps_output, _ = Gitlab::Popen.popen(%W(ps ww -U #{Gitlab.config.gitlab.user} -o pid,pcpu,pmem,stat,start,command))
......
# frozen_string_literal: true
class Admin::BroadcastMessagesController < Admin::ApplicationController
include BroadcastMessagesHelper
......
# frozen_string_literal: true
class Admin::DashboardController < Admin::ApplicationController
include CountHelper
......
# frozen_string_literal: true
class Admin::DeployKeysController < Admin::ApplicationController
before_action :deploy_keys, only: [:index]
before_action :deploy_key, only: [:destroy, :edit, :update]
......
# frozen_string_literal: true
class Admin::GitalyServersController < Admin::ApplicationController
def index
@gitaly_servers = Gitaly::Server.all
......
# frozen_string_literal: true
class Admin::GroupsController < Admin::ApplicationController
include MembersPresentation
......
# frozen_string_literal: true
class Admin::HealthCheckController < Admin::ApplicationController
def show
@errors = HealthCheck::Utils.process_checks(['standard'])
......
# frozen_string_literal: true
class Admin::HookLogsController < Admin::ApplicationController
include HooksExecution
......
# frozen_string_literal: true
class Admin::HooksController < Admin::ApplicationController
include HooksExecution
......
# frozen_string_literal: true
class Admin::IdentitiesController < Admin::ApplicationController
before_action :user
before_action :identity, except: [:index, :new, :create]
......
# frozen_string_literal: true
class Admin::ImpersonationTokensController < Admin::ApplicationController
before_action :user
......
# frozen_string_literal: true
class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin!
before_action :authenticate_impersonator!
......
# frozen_string_literal: true
class Admin::JobsController < Admin::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def index
......
# frozen_string_literal: true
class Admin::KeysController < Admin::ApplicationController
before_action :user, only: [:show, :destroy]
......
# frozen_string_literal: true
class Admin::LabelsController < Admin::ApplicationController
before_action :set_label, only: [:show, :edit, :update, :destroy]
......
# frozen_string_literal: true
class Admin::LogsController < Admin::ApplicationController
before_action :loggers
......
# frozen_string_literal: true
class Admin::ProjectsController < Admin::ApplicationController
include MembersPresentation
......
# frozen_string_literal: true
class Admin::RequestsProfilesController < Admin::ApplicationController
def index
@profile_token = Gitlab::RequestProfiler.profile_token
......
# frozen_string_literal: true
class Admin::RunnerProjectsController < Admin::ApplicationController
before_action :project, only: [:create]
......
# frozen_string_literal: true
class Admin::RunnersController < Admin::ApplicationController
before_action :runner, except: :index
......
# frozen_string_literal: true
class Admin::SpamLogsController < Admin::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def index
......
# frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [
'nobrowse',
......
# frozen_string_literal: true
class Admin::UsersController < Admin::ApplicationController
before_action :user, except: [:index, :new, :create]
......
# frozen_string_literal: true
require 'gon'
require 'fogbugz'
......
# frozen_string_literal: true
class AutocompleteController < ApplicationController
skip_before_action :authenticate_user!, only: [:users, :award_emojis]
......
# frozen_string_literal: true
module Boards
class ApplicationController < ::ApplicationController
respond_to :json
......
# frozen_string_literal: true
module Boards
class IssuesController < Boards::ApplicationController
include BoardsResponses
......
# frozen_string_literal: true
module Boards
class ListsController < Boards::ApplicationController
include BoardsResponses
......
# frozen_string_literal: true
module Ci
class LintsController < ::ApplicationController
before_action :authenticate_user!
......
# frozen_string_literal: true
module AcceptsPendingInvitations
extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == AuthenticatesWithTwoFactor
#
# Controller concern to handle two-factor authentication
......
# frozen_string_literal: true
module BoardsResponses
include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module ChecksCollaboration
def can_collaborate_with_project?(project, ref: nil)
return true if can?(current_user, :push_code, project)
......
# frozen_string_literal: true
module ContinueParams
include InternalRedirect
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ControllerWithCrossProjectAccessCheck
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module CreatesCommit
extend ActiveSupport::Concern
include Gitlab::Utils::StrongMemoize
......@@ -65,7 +67,7 @@ def update_flash_notice(success_notice)
flash[:notice] = nil
else
target = different_project? ? "project" : "branch"
flash[:notice] << " You can now submit a merge request to get this change into the original #{target}."
flash[:notice] = flash[:notice] + " You can now submit a merge request to get this change into the original #{target}."
end
end
end
......
# frozen_string_literal: true
module CycleAnalyticsParams
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module DiffForPath
extend ActiveSupport::Concern
......
# frozen_string_literal: true
# == EnforcesTwoFactorAuthentication
#
# Controller concern to enforce two-factor authentication requirements
......
# frozen_string_literal: true
module GroupTree
# rubocop:disable Gitlab/ModuleWithInstanceVariables
# rubocop: disable CodeReuse/ActiveRecord
......
# frozen_string_literal: true
module HooksExecution
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module InternalRedirect
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module IssuableActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module IssuableCollections
extend ActiveSupport::Concern
include CookiesHelper
......
# frozen_string_literal: true
module IssuesAction
extend ActiveSupport::Concern
include IssuableCollections
......
# frozen_string_literal: true
module IssuesCalendar
extend ActiveSupport::Concern
......
# frozen_string_literal: true
# This concern assumes:
# - a `#project` accessor
# - a `#user` accessor
......
# frozen_string_literal: true
module MembersPresentation
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module MembershipActions
include MembersPresentation
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module MergeRequestsAction
extend ActiveSupport::Concern
include IssuableCollections
......
# frozen_string_literal: true
module MilestoneActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module NotesActions
include RendersNotes
include Gitlab::Utils::StrongMemoize
......
# frozen_string_literal: true
module OauthApplications
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ParamsBackwardCompatibility
private
......
# frozen_string_literal: true
module PreviewMarkdown
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module RendersBlob
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module RendersCommits
def limited_commits(commits)
if commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
......
# frozen_string_literal: true
module RendersMemberAccess
def prepare_groups_for_rendering(groups)
preload_max_member_access_for_collection(Group, groups)
......
# frozen_string_literal: true
module RendersNotes
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def prepare_notes_for_rendering(notes, noteable = nil)
......
# frozen_string_literal: true
module RepositorySettingsRedirect
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module RequiresWhitelistedMonitoringClient
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module RoutableActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module SendFileUpload
def send_upload(file_upload, send_params: {}, redirect_params: {}, attachment: nil, disposition: 'attachment')
if attachment
......
# frozen_string_literal: true
module ServiceParams
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module SnippetsActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module SpammableActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module TodosActions
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ToggleAwardEmoji
extend ActiveSupport::Concern
......
# frozen_string_literal: true
module ToggleSubscriptionAction
extend ActiveSupport::Concern
......
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