Merge branch 'frozen-string-app-controller-more' into 'master'

Enable more frozen string in app/controllers/

See merge request gitlab-org/gitlab-ce!21873
This commit is contained in:
Stan Hu 2018-09-25 17:21:14 +00:00
commit cc8424d4e8
52 changed files with 108 additions and 1 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::ApplicationController < ApplicationController
include ControllerWithCrossProjectAccessCheck

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::GroupsController < Dashboard::ApplicationController
include GroupTree

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::LabelsController < Dashboard::ApplicationController
def index
respond_to do |format|

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::MilestonesController < Dashboard::ApplicationController
include MilestoneActions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::ProjectsController < Dashboard::ApplicationController
include ParamsBackwardCompatibility
include RendersMemberAccess

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::SnippetsController < Dashboard::ApplicationController
skip_cross_project_access_check :index

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Dashboard::TodosController < Dashboard::ApplicationController
include ActionView::Helpers::NumberHelper

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Explore::ApplicationController < ApplicationController
skip_before_action :authenticate_user!

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Explore::GroupsController < Explore::ApplicationController
include GroupTree

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Explore::ProjectsController < Explore::ApplicationController
include ParamsBackwardCompatibility
include RendersMemberAccess

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Explore::SnippetsController < Explore::ApplicationController
def index
@snippets = SnippetsFinder.new(current_user).execute

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module GoogleApi
class AuthorizationsController < ApplicationController
def callback

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::ApplicationController < ApplicationController
include RoutableActions
include ControllerWithCrossProjectAccessCheck

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::AvatarsController < Groups::ApplicationController
before_action :authorize_admin_group!

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::BoardsController < Groups::ApplicationController
include BoardsResponses

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Groups
class ChildrenController < Groups::ApplicationController
before_action :group

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::GroupMembersController < Groups::ApplicationController
include MembershipActions
include MembersPresentation

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::LabelsController < Groups::ApplicationController
include ToggleSubscriptionAction

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::MilestonesController < Groups::ApplicationController
include MilestoneActions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::RunnersController < Groups::ApplicationController
# Proper policies should be implemented per
# https://gitlab.com/gitlab-org/gitlab-ce/issues/45894

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Groups
module Settings
class CiCdController < Groups::ApplicationController

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Groups
class SharedProjectsController < Groups::ApplicationController
respond_to :json

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Groups::UploadsController < Groups::ApplicationController
include UploadsActions
include WorkhorseRequest

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Groups
class VariablesController < Groups::ApplicationController
before_action :authorize_admin_build!

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::BaseController < ApplicationController
private

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::BitbucketController < Import::BaseController
before_action :verify_bitbucket_import_enabled
before_action :bitbucket_auth, except: :callback

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::FogbugzController < Import::BaseController
before_action :verify_fogbugz_import_enabled
before_action :user_map, only: [:new_user_map, :create_user_map]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::GiteaController < Import::GithubController
def new
if session[access_token_key].present? && session[host_key].present?

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::GithubController < Import::BaseController
before_action :verify_import_enabled
before_action :provider_auth, only: [:status, :jobs, :create]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::GitlabController < Import::BaseController
MAX_PROJECT_PAGES = 15
PER_PAGE_PROJECTS = 100

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::GitlabProjectsController < Import::BaseController
before_action :whitelist_query_limiting, only: [:create]
before_action :verify_gitlab_project_import_enabled

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::GoogleCodeController < Import::BaseController
before_action :verify_google_code_import_enabled
before_action :user_map, only: [:new_user_map, :create_user_map]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Import::ManifestController < Import::BaseController
before_action :whitelist_query_limiting, only: [:create]
before_action :verify_import_enabled

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Ldap::OmniauthCallbacksController < OmniauthCallbacksController
extend ::Gitlab::Utils::Override

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
include Gitlab::GonHelper
include Gitlab::Allowable

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
layout 'profile'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
include PageLayoutHelper

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::AccountsController < Profiles::ApplicationController
include AuthHelper

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::ActiveSessionsController < Profiles::ApplicationController
def index
@sessions = ActiveSession.list(current_user)

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::ApplicationController < ApplicationController
layout 'profile'
end

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::AvatarsController < Profiles::ApplicationController
def destroy
@user = current_user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::ChatNamesController < Profiles::ApplicationController
before_action :chat_name_token, only: [:new]
before_action :chat_name_params, only: [:new, :create, :deny]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::EmailsController < Profiles::ApplicationController
before_action :find_email, only: [:destroy, :resend_confirmation_instructions]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::GpgKeysController < Profiles::ApplicationController
before_action :set_gpg_key, only: [:destroy, :revoke]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::NotificationsController < Profiles::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
def show

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::PasswordsController < Profiles::ApplicationController
skip_before_action :check_password_expiration, only: [:new, :create]
skip_before_action :check_two_factor_requirement, only: [:new, :create]

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
def index
set_index_vars

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::PreferencesController < Profiles::ApplicationController
before_action :user

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
skip_before_action :check_two_factor_requirement
@ -30,7 +32,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
unless two_factor_grace_period_expired?
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

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Profiles::U2fRegistrationsController < Profiles::ApplicationController
def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id])

View File

@ -0,0 +1,5 @@
---
title: Enable more frozen string in app/controllers/
merge_request:
author: gfyoung
type: performance