Skip to content
Snippets Groups Projects
Commit 811e598f authored by Sean McGivern's avatar Sean McGivern
Browse files

Enable and autocorrect the CustomErrorClass cop

parent 8dd097a9
No related branches found
No related tags found
No related merge requests found
Showing
with 24 additions and 29 deletions
Loading
Loading
@@ -5,7 +5,7 @@ class Projects::BlobController < Projects::ApplicationController
include ActionView::Helpers::SanitizeHelper
 
# Raised when given an invalid file path
class InvalidPathError < StandardError; end
InvalidPathError = Class.new(StandardError)
 
before_action :require_non_empty_project, except: [:new, :create]
before_action :authorize_download_code!
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@ class Project < ActiveRecord::Base
 
extend Gitlab::ConfigHelper
 
class BoardLimitExceeded < StandardError; end
BoardLimitExceeded = Class.new(StandardError)
 
NUMBER_OF_PERMITTED_BOARDS = 1
UNKNOWN_IMPORT_URL = 'http://unknown.git'.freeze
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@ class ProjectWiki
'AsciiDoc' => :asciidoc
}.freeze unless defined?(MARKUPS)
 
class CouldNotCreateWikiError < StandardError; end
CouldNotCreateWikiError = Class.new(StandardError)
 
# Returns a string describing what went wrong after
# an operation fails.
Loading
Loading
class PipelineSerializer < BaseSerializer
class InvalidResourceError < StandardError; end
InvalidResourceError = Class.new(StandardError)
 
entity PipelineEntity
 
Loading
Loading
module Commits
class ChangeService < ::BaseService
class ValidationError < StandardError; end
class ChangeError < StandardError; end
ValidationError = Class.new(StandardError)
ChangeError = Class.new(StandardError)
 
def execute
@start_project = params[:start_project] || @project
Loading
Loading
module Files
class BaseService < ::BaseService
class ValidationError < StandardError; end
ValidationError = Class.new(StandardError)
 
def execute
@start_project = params[:start_project] || @project
Loading
Loading
module Files
class MultiService < Files::BaseService
class FileChangedError < StandardError; end
FileChangedError = Class.new(StandardError)
 
ACTIONS = %w[create update delete move].freeze
 
Loading
Loading
module Files
class UpdateService < Files::BaseService
class FileChangedError < StandardError; end
FileChangedError = Class.new(StandardError)
 
def commit
repository.update_file(current_user, @file_path, @file_content,
Loading
Loading
module Issues
class MoveService < Issues::BaseService
class MoveError < StandardError; end
MoveError = Class.new(StandardError)
 
def execute(issue, new_project)
@old_issue = issue
Loading
Loading
module MergeRequests
class ResolveService < MergeRequests::BaseService
class MissingFiles < Gitlab::Conflict::ResolutionError
end
MissingFiles = Class.new(Gitlab::Conflict::ResolutionError)
 
attr_accessor :conflicts, :rugged, :merge_index, :merge_request
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ module Projects
class DestroyService < BaseService
include Gitlab::ShellAdapter
 
class DestroyError < StandardError; end
DestroyError = Class.new(StandardError)
 
DELETED_FLAG = '+deleted'.freeze
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ module Projects
class ImportService < BaseService
include Gitlab::ShellAdapter
 
class Error < StandardError; end
Error = Class.new(StandardError)
 
def execute
add_repository_to_project unless project.gitlab_project_import?
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@
module Projects
class TransferService < BaseService
include Gitlab::ShellAdapter
class TransferError < StandardError; end
TransferError = Class.new(StandardError)
 
def execute(new_namespace)
if allowed_transfer?(current_user, project, new_namespace)
Loading
Loading
Loading
Loading
@@ -160,13 +160,10 @@ module API
# Exceptions
#
 
class MissingTokenError < StandardError; end
class TokenNotFoundError < StandardError; end
class ExpiredError < StandardError; end
class RevokedError < StandardError; end
MissingTokenError = Class.new(StandardError)
TokenNotFoundError = Class.new(StandardError)
ExpiredError = Class.new(StandardError)
RevokedError = Class.new(StandardError)
 
class InsufficientScopeError < StandardError
attr_reader :scopes
Loading
Loading
module Bitbucket
module Error
class Unauthorized < StandardError
end
Unauthorized = Class.new(StandardError)
end
end
module Ci
class GitlabCiYamlProcessor
class ValidationError < StandardError; end
ValidationError = Class.new(StandardError)
 
include Gitlab::Ci::Config::Entry::LegacyValidationHelpers
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
# file path string when combined in a request parameter
module ExtractsPath
# Raised when given an invalid file path
class InvalidPathError < StandardError; end
InvalidPathError = Class.new(StandardError)
 
# Given a string containing both a Git tree-ish, such as a branch or tag, and
# a filesystem path joined by forward slashes, attempts to separate the two.
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@
#
module Gitlab
module Access
class AccessDeniedError < StandardError; end
AccessDeniedError = Class.new(StandardError)
 
NO_ACCESS = 0
GUEST = 10
Loading
Loading
module Gitlab
module Auth
class MissingPersonalTokenError < StandardError; end
MissingPersonalTokenError = Class.new(StandardError)
 
SCOPES = [:api, :read_user].freeze
DEFAULT_SCOPES = [:api].freeze
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ module Gitlab
module Build
module Artifacts
class Metadata
class ParserError < StandardError; end
ParserError = Class.new(StandardError)
 
VERSION_PATTERN = /^[\w\s]+(\d+\.\d+\.\d+)/
INVALID_PATH_PATTERN = %r{(^\.?\.?/)|(/\.?\.?/)}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment