Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
811e598f
Commit
811e598f
authored
Mar 01, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable and autocorrect the CustomErrorClass cop
parent
8dd097a9
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
64 additions
and
81 deletions
+64
-81
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-1
app/models/project_wiki.rb
app/models/project_wiki.rb
+1
-1
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+1
-1
app/services/commits/change_service.rb
app/services/commits/change_service.rb
+2
-2
app/services/files/base_service.rb
app/services/files/base_service.rb
+1
-1
app/services/files/multi_service.rb
app/services/files/multi_service.rb
+1
-1
app/services/files/update_service.rb
app/services/files/update_service.rb
+1
-1
app/services/issues/move_service.rb
app/services/issues/move_service.rb
+1
-1
app/services/merge_requests/resolve_service.rb
app/services/merge_requests/resolve_service.rb
+1
-2
app/services/projects/destroy_service.rb
app/services/projects/destroy_service.rb
+1
-1
app/services/projects/import_service.rb
app/services/projects/import_service.rb
+1
-1
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+1
-1
lib/api/api_guard.rb
lib/api/api_guard.rb
+4
-7
lib/bitbucket/error/unauthorized.rb
lib/bitbucket/error/unauthorized.rb
+1
-2
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+1
-1
lib/extracts_path.rb
lib/extracts_path.rb
+1
-1
lib/gitlab/access.rb
lib/gitlab/access.rb
+1
-1
lib/gitlab/auth.rb
lib/gitlab/auth.rb
+1
-1
lib/gitlab/ci/build/artifacts/metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+1
-1
lib/gitlab/ci/config/entry/factory.rb
lib/gitlab/ci/config/entry/factory.rb
+1
-1
lib/gitlab/ci/config/entry/node.rb
lib/gitlab/ci/config/entry/node.rb
+1
-1
lib/gitlab/ci/config/loader.rb
lib/gitlab/ci/config/loader.rb
+1
-1
lib/gitlab/conflict/file.rb
lib/gitlab/conflict/file.rb
+1
-2
lib/gitlab/conflict/file_collection.rb
lib/gitlab/conflict/file_collection.rb
+1
-2
lib/gitlab/conflict/parser.rb
lib/gitlab/conflict/parser.rb
+6
-16
lib/gitlab/conflict/resolution_error.rb
lib/gitlab/conflict/resolution_error.rb
+1
-2
lib/gitlab/email/receiver.rb
lib/gitlab/email/receiver.rb
+13
-13
lib/gitlab/git/diff.rb
lib/gitlab/git/diff.rb
+1
-1
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+3
-3
lib/gitlab/import_export/error.rb
lib/gitlab/import_export/error.rb
+1
-1
lib/gitlab/o_auth/user.rb
lib/gitlab/o_auth/user.rb
+1
-1
lib/gitlab/route_map.rb
lib/gitlab/route_map.rb
+1
-1
lib/gitlab/serializer/pagination.rb
lib/gitlab/serializer/pagination.rb
+1
-1
lib/gitlab/shell.rb
lib/gitlab/shell.rb
+1
-1
lib/gitlab/template/finders/repo_template_finder.rb
lib/gitlab/template/finders/repo_template_finder.rb
+1
-1
lib/gitlab/update_path_error.rb
lib/gitlab/update_path_error.rb
+1
-1
lib/mattermost/client.rb
lib/mattermost/client.rb
+1
-1
lib/mattermost/error.rb
lib/mattermost/error.rb
+1
-1
lib/mattermost/session.rb
lib/mattermost/session.rb
+1
-1
rubocop/rubocop.rb
rubocop/rubocop.rb
+1
-0
No files found.
app/controllers/projects/blob_controller.rb
View file @
811e598f
...
...
@@ -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!
...
...
app/models/project.rb
View file @
811e598f
...
...
@@ -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
...
...
app/models/project_wiki.rb
View file @
811e598f
...
...
@@ -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.
...
...
app/serializers/pipeline_serializer.rb
View file @
811e598f
class
PipelineSerializer
<
BaseSerializer
class
InvalidResourceError
<
StandardError
;
end
InvalidResourceError
=
Class
.
new
(
StandardError
)
entity
PipelineEntity
...
...
app/services/commits/change_service.rb
View file @
811e598f
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
...
...
app/services/files/base_service.rb
View file @
811e598f
module
Files
class
BaseService
<
::
BaseService
class
ValidationError
<
StandardError
;
end
ValidationError
=
Class
.
new
(
StandardError
)
def
execute
@start_project
=
params
[
:start_project
]
||
@project
...
...
app/services/files/multi_service.rb
View file @
811e598f
module
Files
class
MultiService
<
Files
::
BaseService
class
FileChangedError
<
StandardError
;
end
FileChangedError
=
Class
.
new
(
StandardError
)
ACTIONS
=
%w[create update delete move]
.
freeze
...
...
app/services/files/update_service.rb
View file @
811e598f
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
,
...
...
app/services/issues/move_service.rb
View file @
811e598f
module
Issues
class
MoveService
<
Issues
::
BaseService
class
MoveError
<
StandardError
;
end
MoveError
=
Class
.
new
(
StandardError
)
def
execute
(
issue
,
new_project
)
@old_issue
=
issue
...
...
app/services/merge_requests/resolve_service.rb
View file @
811e598f
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
...
...
app/services/projects/destroy_service.rb
View file @
811e598f
...
...
@@ -2,7 +2,7 @@ module Projects
class
DestroyService
<
BaseService
include
Gitlab
::
ShellAdapter
class
DestroyError
<
StandardError
;
end
DestroyError
=
Class
.
new
(
StandardError
)
DELETED_FLAG
=
'+deleted'
.
freeze
...
...
app/services/projects/import_service.rb
View file @
811e598f
...
...
@@ -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?
...
...
app/services/projects/transfer_service.rb
View file @
811e598f
...
...
@@ -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
)
...
...
lib/api/api_guard.rb
View file @
811e598f
...
...
@@ -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
...
...
lib/bitbucket/error/unauthorized.rb
View file @
811e598f
module
Bitbucket
module
Error
class
Unauthorized
<
StandardError
end
Unauthorized
=
Class
.
new
(
StandardError
)
end
end
lib/ci/gitlab_ci_yaml_processor.rb
View file @
811e598f
module
Ci
class
GitlabCiYamlProcessor
class
ValidationError
<
StandardError
;
end
ValidationError
=
Class
.
new
(
StandardError
)
include
Gitlab
::
Ci
::
Config
::
Entry
::
LegacyValidationHelpers
...
...
lib/extracts_path.rb
View file @
811e598f
...
...
@@ -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.
...
...
lib/gitlab/access.rb
View file @
811e598f
...
...
@@ -5,7 +5,7 @@
#
module
Gitlab
module
Access
class
AccessDeniedError
<
StandardError
;
end
AccessDeniedError
=
Class
.
new
(
StandardError
)
NO_ACCESS
=
0
GUEST
=
10
...
...
lib/gitlab/auth.rb
View file @
811e598f
module
Gitlab
module
Auth
class
MissingPersonalTokenError
<
StandardError
;
end
MissingPersonalTokenError
=
Class
.
new
(
StandardError
)
SCOPES
=
[
:api
,
:read_user
].
freeze
DEFAULT_SCOPES
=
[
:api
].
freeze
...
...
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
811e598f
...
...
@@ -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{(^
\.
?
\.
?/)|(/
\.
?
\.
?/)}
...
...
lib/gitlab/ci/config/entry/factory.rb
View file @
811e598f
...
...
@@ -6,7 +6,7 @@ module Gitlab
# Factory class responsible for fabricating entry objects.
#
class
Factory
class
InvalidFactory
<
StandardError
;
end
InvalidFactory
=
Class
.
new
(
StandardError
)
def
initialize
(
entry
)
@entry
=
entry
...
...
lib/gitlab/ci/config/entry/node.rb
View file @
811e598f
...
...
@@ -6,7 +6,7 @@ module Gitlab
# Base abstract class for each configuration entry node.
#
class
Node
class
InvalidError
<
StandardError
;
end
InvalidError
=
Class
.
new
(
StandardError
)
attr_reader
:config
,
:metadata
attr_accessor
:key
,
:parent
,
:description
...
...
lib/gitlab/ci/config/loader.rb
View file @
811e598f
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
Ci
class
Config
class
Loader
class
FormatError
<
StandardError
;
end
FormatError
=
Class
.
new
(
StandardError
)
def
initialize
(
config
)
@config
=
YAML
.
safe_load
(
config
,
[
Symbol
],
[],
true
)
...
...
lib/gitlab/conflict/file.rb
View file @
811e598f
...
...
@@ -4,8 +4,7 @@ module Gitlab
include
Gitlab
::
Routing
.
url_helpers
include
IconsHelper
class
MissingResolution
<
ResolutionError
end
MissingResolution
=
Class
.
new
(
ResolutionError
)
CONTEXT_LINES
=
3
...
...
lib/gitlab/conflict/file_collection.rb
View file @
811e598f
module
Gitlab
module
Conflict
class
FileCollection
class
ConflictSideMissing
<
StandardError
end
ConflictSideMissing
=
Class
.
new
(
StandardError
)
attr_reader
:merge_request
,
:our_commit
,
:their_commit
...
...
lib/gitlab/conflict/parser.rb
View file @
811e598f
module
Gitlab
module
Conflict
class
Parser
class
UnresolvableError
<
StandardError
end
class
UnmergeableFile
<
UnresolvableError
end
class
UnsupportedEncoding
<
UnresolvableError
end
UnresolvableError
=
Class
.
new
(
StandardError
)
UnmergeableFile
=
Class
.
new
(
UnresolvableError
)
UnsupportedEncoding
=
Class
.
new
(
UnresolvableError
)
# Recoverable errors - the conflict can be resolved in an editor, but not with
# sections.
class
ParserError
<
StandardError
end
class
UnexpectedDelimiter
<
ParserError
end
class
MissingEndDelimiter
<
ParserError
end
ParserError
=
Class
.
new
(
StandardError
)
UnexpectedDelimiter
=
Class
.
new
(
ParserError
)
MissingEndDelimiter
=
Class
.
new
(
ParserError
)
def
parse
(
text
,
our_path
:,
their_path
:,
parent_file:
nil
)
raise
UnmergeableFile
if
text
.
blank?
# Typically a binary file
...
...
lib/gitlab/conflict/resolution_error.rb
View file @
811e598f
module
Gitlab
module
Conflict
class
ResolutionError
<
StandardError
end
ResolutionError
=
Class
.
new
(
StandardError
)
end
end
lib/gitlab/email/receiver.rb
View file @
811e598f
...
...
@@ -4,19 +4,19 @@ require_dependency 'gitlab/email/handler'
# Inspired in great part by Discourse's Email::Receiver
module
Gitlab
module
Email
class
ProcessingError
<
StandardError
;
end
class
EmailUnparsableError
<
ProcessingError
;
end
class
SentNotificationNotFoundError
<
ProcessingError
;
end
class
ProjectNotFound
<
ProcessingError
;
end
class
EmptyEmailError
<
ProcessingError
;
end
class
AutoGeneratedEmailError
<
ProcessingError
;
end
class
UserNotFoundError
<
ProcessingError
;
end
class
UserBlockedError
<
ProcessingError
;
end
class
UserNotAuthorizedError
<
ProcessingError
;
end
class
NoteableNotFoundError
<
ProcessingError
;
end
class
InvalidNoteError
<
ProcessingError
;
end
class
InvalidIssueError
<
ProcessingError
;
end
class
UnknownIncomingEmail
<
ProcessingError
;
end
ProcessingError
=
Class
.
new
(
StandardError
)
EmailUnparsableError
=
Class
.
new
(
ProcessingError
)
SentNotificationNotFoundError
=
Class
.
new
(
ProcessingError
)
ProjectNotFound
=
Class
.
new
(
ProcessingError
)
EmptyEmailError
=
Class
.
new
(
ProcessingError
)
AutoGeneratedEmailError
=
Class
.
new
(
ProcessingError
)
UserNotFoundError
=
Class
.
new
(
ProcessingError
)
UserBlockedError
=
Class
.
new
(
ProcessingError
)
UserNotAuthorizedError
=
Class
.
new
(
ProcessingError
)
NoteableNotFoundError
=
Class
.
new
(
ProcessingError
)
InvalidNoteError
=
Class
.
new
(
ProcessingError
)
InvalidIssueError
=
Class
.
new
(
ProcessingError
)
UnknownIncomingEmail
=
Class
.
new
(
ProcessingError
)
class
Receiver
def
initialize
(
raw
)
...
...
lib/gitlab/git/diff.rb
View file @
811e598f
...
...
@@ -2,7 +2,7 @@
module
Gitlab
module
Git
class
Diff
class
TimeoutError
<
StandardError
;
end
TimeoutError
=
Class
.
new
(
StandardError
)
include
Gitlab
::
Git
::
EncodingHelper
# Diff properties
...
...
lib/gitlab/git/repository.rb
View file @
811e598f
...
...
@@ -10,9 +10,9 @@ module Gitlab
SEARCH_CONTEXT_LINES
=
3
class
NoRepository
<
StandardError
;
end
class
InvalidBlobName
<
StandardError
;
end
class
InvalidRef
<
StandardError
;
end
NoRepository
=
Class
.
new
(
StandardError
)
InvalidBlobName
=
Class
.
new
(
StandardError
)
InvalidRef
=
Class
.
new
(
StandardError
)
# Full path to repo
attr_reader
:path
...
...
lib/gitlab/import_export/error.rb
View file @
811e598f
module
Gitlab
module
ImportExport
class
Error
<
StandardError
;
end
Error
=
Class
.
new
(
StandardError
)
end
end
lib/gitlab/o_auth/user.rb
View file @
811e598f
...
...
@@ -5,7 +5,7 @@
#
module
Gitlab
module
OAuth
class
SignupDisabledError
<
StandardError
;
end
SignupDisabledError
=
Class
.
new
(
StandardError
)
class
User
attr_accessor
:auth_hash
,
:gl_user
...
...
lib/gitlab/route_map.rb
View file @
811e598f
module
Gitlab
class
RouteMap
class
FormatError
<
StandardError
;
end
FormatError
=
Class
.
new
(
StandardError
)
def
initialize
(
data
)
begin
...
...
lib/gitlab/serializer/pagination.rb
View file @
811e598f
module
Gitlab
module
Serializer
class
Pagination
class
InvalidResourceError
<
StandardError
;
end
InvalidResourceError
=
Class
.
new
(
StandardError
)
include
::
API
::
Helpers
::
Pagination
def
initialize
(
request
,
response
)
...
...
lib/gitlab/shell.rb
View file @
811e598f
...
...
@@ -2,7 +2,7 @@ require 'securerandom'
module
Gitlab
class
Shell
class
Error
<
StandardError
;
end
Error
=
Class
.
new
(
StandardError
)
KeyAdder
=
Struct
.
new
(
:io
)
do
def
add_key
(
id
,
key
)
...
...
lib/gitlab/template/finders/repo_template_finder.rb
View file @
811e598f
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Finders
class
RepoTemplateFinder
<
BaseTemplateFinder
# Raised when file is not found
class
FileNotFoundError
<
StandardError
;
end
FileNotFoundError
=
Class
.
new
(
StandardError
)
def
initialize
(
project
,
base_dir
,
extension
,
categories
=
{})
@categories
=
categories
...
...
lib/gitlab/update_path_error.rb
View file @
811e598f
module
Gitlab
class
UpdatePathError
<
StandardError
;
end
UpdatePathError
=
Class
.
new
(
StandardError
)
end
lib/mattermost/client.rb
View file @
811e598f
module
Mattermost
class
ClientError
<
Mattermost
::
Error
;
end
ClientError
=
Class
.
new
(
Mattermost
::
Error
)
class
Client
attr_reader
:user
...
...
lib/mattermost/error.rb
View file @
811e598f
module
Mattermost
class
Error
<
StandardError
;
end
Error
=
Class
.
new
(
StandardError
)
end
lib/mattermost/session.rb
View file @
811e598f
...
...
@@ -5,7 +5,7 @@ module Mattermost
end
end
class
ConnectionError
<
Mattermost
::
Error
;
end
ConnectionError
=
Class
.
new
(
Mattermost
::
Error
)
# This class' prime objective is to obtain a session token on a Mattermost
# instance with SSO configured where this GitLab instance is the provider.
...
...
rubocop/rubocop.rb
View file @
811e598f
require_relative
'cop/custom_error_class'
require_relative
'cop/gem_fetcher'
require_relative
'cop/migration/add_column'
require_relative
'cop/migration/add_column_with_default'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment