Commit be42c050 authored by gfyoung's avatar gfyoung

Enable more frozen string in app/controllers/

Enables frozen string for the following:

* app/controllers/dashboard/**/*.rb
* app/controllers/explore/**/*.rb
* app/controllers/google_api/**/*.rb
* app/controllers/groups/**/*.rb
* app/controllers/import/**/*.rb
* app/controllers/instance_statistics/**/*.rb
* app/controllers/ldap/**/*.rb
* app/controllers/oauth/**/*.rb
* app/controllers/profiles/**/*.rb

Partially addresses #47424.
parent 4c8d2232
# frozen_string_literal: true
class Dashboard::ApplicationController < ApplicationController class Dashboard::ApplicationController < ApplicationController
include ControllerWithCrossProjectAccessCheck include ControllerWithCrossProjectAccessCheck
......
# frozen_string_literal: true
class Dashboard::GroupsController < Dashboard::ApplicationController class Dashboard::GroupsController < Dashboard::ApplicationController
include GroupTree include GroupTree
......
# frozen_string_literal: true
class Dashboard::LabelsController < Dashboard::ApplicationController class Dashboard::LabelsController < Dashboard::ApplicationController
def index def index
respond_to do |format| respond_to do |format|
......
# frozen_string_literal: true
class Dashboard::MilestonesController < Dashboard::ApplicationController class Dashboard::MilestonesController < Dashboard::ApplicationController
include MilestoneActions include MilestoneActions
......
# frozen_string_literal: true
class Dashboard::ProjectsController < Dashboard::ApplicationController class Dashboard::ProjectsController < Dashboard::ApplicationController
include ParamsBackwardCompatibility include ParamsBackwardCompatibility
include RendersMemberAccess include RendersMemberAccess
......
# frozen_string_literal: true
class Dashboard::SnippetsController < Dashboard::ApplicationController class Dashboard::SnippetsController < Dashboard::ApplicationController
skip_cross_project_access_check :index skip_cross_project_access_check :index
......
# frozen_string_literal: true
class Dashboard::TodosController < Dashboard::ApplicationController class Dashboard::TodosController < Dashboard::ApplicationController
include ActionView::Helpers::NumberHelper include ActionView::Helpers::NumberHelper
......
# frozen_string_literal: true
class Explore::ApplicationController < ApplicationController class Explore::ApplicationController < ApplicationController
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
......
# frozen_string_literal: true
class Explore::GroupsController < Explore::ApplicationController class Explore::GroupsController < Explore::ApplicationController
include GroupTree include GroupTree
......
# frozen_string_literal: true
class Explore::ProjectsController < Explore::ApplicationController class Explore::ProjectsController < Explore::ApplicationController
include ParamsBackwardCompatibility include ParamsBackwardCompatibility
include RendersMemberAccess include RendersMemberAccess
......
# frozen_string_literal: true
class Explore::SnippetsController < Explore::ApplicationController class Explore::SnippetsController < Explore::ApplicationController
def index def index
@snippets = SnippetsFinder.new(current_user).execute @snippets = SnippetsFinder.new(current_user).execute
......
# frozen_string_literal: true
module GoogleApi module GoogleApi
class AuthorizationsController < ApplicationController class AuthorizationsController < ApplicationController
def callback def callback
......
# frozen_string_literal: true
class Groups::ApplicationController < ApplicationController class Groups::ApplicationController < ApplicationController
include RoutableActions include RoutableActions
include ControllerWithCrossProjectAccessCheck include ControllerWithCrossProjectAccessCheck
......
# frozen_string_literal: true
class Groups::AvatarsController < Groups::ApplicationController class Groups::AvatarsController < Groups::ApplicationController
before_action :authorize_admin_group! before_action :authorize_admin_group!
......
# frozen_string_literal: true
class Groups::BoardsController < Groups::ApplicationController class Groups::BoardsController < Groups::ApplicationController
include BoardsResponses include BoardsResponses
......
# frozen_string_literal: true
module Groups module Groups
class ChildrenController < Groups::ApplicationController class ChildrenController < Groups::ApplicationController
before_action :group before_action :group
......
# frozen_string_literal: true
class Groups::GroupMembersController < Groups::ApplicationController class Groups::GroupMembersController < Groups::ApplicationController
include MembershipActions include MembershipActions
include MembersPresentation include MembersPresentation
......
# frozen_string_literal: true
class Groups::LabelsController < Groups::ApplicationController class Groups::LabelsController < Groups::ApplicationController
include ToggleSubscriptionAction include ToggleSubscriptionAction
......
# frozen_string_literal: true
class Groups::MilestonesController < Groups::ApplicationController class Groups::MilestonesController < Groups::ApplicationController
include MilestoneActions include MilestoneActions
......
# frozen_string_literal: true
class Groups::RunnersController < Groups::ApplicationController class Groups::RunnersController < Groups::ApplicationController
# Proper policies should be implemented per # Proper policies should be implemented per
# https://gitlab.com/gitlab-org/gitlab-ce/issues/45894 # https://gitlab.com/gitlab-org/gitlab-ce/issues/45894
......
# frozen_string_literal: true
module Groups module Groups
module Settings module Settings
class CiCdController < Groups::ApplicationController class CiCdController < Groups::ApplicationController
......
# frozen_string_literal: true
module Groups module Groups
class SharedProjectsController < Groups::ApplicationController class SharedProjectsController < Groups::ApplicationController
respond_to :json respond_to :json
......
# frozen_string_literal: true
class Groups::UploadsController < Groups::ApplicationController class Groups::UploadsController < Groups::ApplicationController
include UploadsActions include UploadsActions
include WorkhorseRequest include WorkhorseRequest
......
# frozen_string_literal: true
module Groups module Groups
class VariablesController < Groups::ApplicationController class VariablesController < Groups::ApplicationController
before_action :authorize_admin_build! before_action :authorize_admin_build!
......
# frozen_string_literal: true
class Import::BaseController < ApplicationController class Import::BaseController < ApplicationController
private private
......
# frozen_string_literal: true
class Import::BitbucketController < Import::BaseController class Import::BitbucketController < Import::BaseController
before_action :verify_bitbucket_import_enabled before_action :verify_bitbucket_import_enabled
before_action :bitbucket_auth, except: :callback before_action :bitbucket_auth, except: :callback
......
# frozen_string_literal: true
class Import::FogbugzController < Import::BaseController class Import::FogbugzController < Import::BaseController
before_action :verify_fogbugz_import_enabled before_action :verify_fogbugz_import_enabled
before_action :user_map, only: [:new_user_map, :create_user_map] before_action :user_map, only: [:new_user_map, :create_user_map]
......
# frozen_string_literal: true
class Import::GiteaController < Import::GithubController class Import::GiteaController < Import::GithubController
def new def new
if session[access_token_key].present? && session[host_key].present? if session[access_token_key].present? && session[host_key].present?
......
# frozen_string_literal: true
class Import::GithubController < Import::BaseController class Import::GithubController < Import::BaseController
before_action :verify_import_enabled before_action :verify_import_enabled
before_action :provider_auth, only: [:status, :jobs, :create] before_action :provider_auth, only: [:status, :jobs, :create]
......
# frozen_string_literal: true
class Import::GitlabController < Import::BaseController class Import::GitlabController < Import::BaseController
MAX_PROJECT_PAGES = 15 MAX_PROJECT_PAGES = 15
PER_PAGE_PROJECTS = 100 PER_PAGE_PROJECTS = 100
......
# frozen_string_literal: true
class Import::GitlabProjectsController < Import::BaseController class Import::GitlabProjectsController < Import::BaseController
before_action :whitelist_query_limiting, only: [:create] before_action :whitelist_query_limiting, only: [:create]
before_action :verify_gitlab_project_import_enabled before_action :verify_gitlab_project_import_enabled
......
# frozen_string_literal: true
class Import::GoogleCodeController < Import::BaseController class Import::GoogleCodeController < Import::BaseController
before_action :verify_google_code_import_enabled before_action :verify_google_code_import_enabled
before_action :user_map, only: [:new_user_map, :create_user_map] before_action :user_map, only: [:new_user_map, :create_user_map]
......
# frozen_string_literal: true
class Import::ManifestController < Import::BaseController class Import::ManifestController < Import::BaseController
before_action :whitelist_query_limiting, only: [:create] before_action :whitelist_query_limiting, only: [:create]
before_action :verify_import_enabled before_action :verify_import_enabled
......
# frozen_string_literal: true
class Ldap::OmniauthCallbacksController < OmniauthCallbacksController class Ldap::OmniauthCallbacksController < OmniauthCallbacksController
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
......
# frozen_string_literal: true
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
include Gitlab::GonHelper include Gitlab::GonHelper
include Gitlab::Allowable include Gitlab::Allowable
......
# frozen_string_literal: true
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
layout 'profile' layout 'profile'
......
# frozen_string_literal: true
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
include PageLayoutHelper include PageLayoutHelper
......
# frozen_string_literal: true
class Profiles::AccountsController < Profiles::ApplicationController class Profiles::AccountsController < Profiles::ApplicationController
include AuthHelper include AuthHelper
......
# frozen_string_literal: true
class Profiles::ActiveSessionsController < Profiles::ApplicationController class Profiles::ActiveSessionsController < Profiles::ApplicationController
def index def index
@sessions = ActiveSession.list(current_user) @sessions = ActiveSession.list(current_user)
......
# frozen_string_literal: true
class Profiles::ApplicationController < ApplicationController class Profiles::ApplicationController < ApplicationController
layout 'profile' layout 'profile'
end end
# frozen_string_literal: true
class Profiles::AvatarsController < Profiles::ApplicationController class Profiles::AvatarsController < Profiles::ApplicationController
def destroy def destroy
@user = current_user @user = current_user
......
# frozen_string_literal: true
class Profiles::ChatNamesController < Profiles::ApplicationController class Profiles::ChatNamesController < Profiles::ApplicationController
before_action :chat_name_token, only: [:new] before_action :chat_name_token, only: [:new]
before_action :chat_name_params, only: [:new, :create, :deny] before_action :chat_name_params, only: [:new, :create, :deny]
......
# frozen_string_literal: true
class Profiles::EmailsController < Profiles::ApplicationController class Profiles::EmailsController < Profiles::ApplicationController
before_action :find_email, only: [:destroy, :resend_confirmation_instructions] before_action :find_email, only: [:destroy, :resend_confirmation_instructions]
......
# frozen_string_literal: true
class Profiles::GpgKeysController < Profiles::ApplicationController class Profiles::GpgKeysController < Profiles::ApplicationController
before_action :set_gpg_key, only: [:destroy, :revoke] before_action :set_gpg_key, only: [:destroy, :revoke]
......
# frozen_string_literal: true
class Profiles::KeysController < Profiles::ApplicationController class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys] skip_before_action :authenticate_user!, only: [:get_keys]
......
# frozen_string_literal: true
class Profiles::NotificationsController < Profiles::ApplicationController class Profiles::NotificationsController < Profiles::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def show def show
......
# frozen_string_literal: true
class Profiles::PasswordsController < Profiles::ApplicationController class Profiles::PasswordsController < Profiles::ApplicationController
skip_before_action :check_password_expiration, only: [:new, :create] skip_before_action :check_password_expiration, only: [:new, :create]
skip_before_action :check_two_factor_requirement, only: [:new, :create] skip_before_action :check_two_factor_requirement, only: [:new, :create]
......
# frozen_string_literal: true
class Profiles::PersonalAccessTokensController < Profiles::ApplicationController class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
def index def index
set_index_vars set_index_vars
......
# frozen_string_literal: true
class Profiles::PreferencesController < Profiles::ApplicationController class Profiles::PreferencesController < Profiles::ApplicationController
before_action :user before_action :user
......
# frozen_string_literal: true
class Profiles::TwoFactorAuthsController < Profiles::ApplicationController class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
skip_before_action :check_two_factor_requirement skip_before_action :check_two_factor_requirement
...@@ -30,7 +32,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController ...@@ -30,7 +32,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
unless two_factor_grace_period_expired? unless two_factor_grace_period_expired?
grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours
flash.now[:alert] << " You need to do this before #{l(grace_period_deadline)}." flash.now[:alert] = flash.now[:alert] + " You need to do this before #{l(grace_period_deadline)}."
end end
end end
......
# frozen_string_literal: true
class Profiles::U2fRegistrationsController < Profiles::ApplicationController class Profiles::U2fRegistrationsController < Profiles::ApplicationController
def destroy def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id]) u2f_registration = current_user.u2f_registrations.find(params[:id])
......
---
title: Enable 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