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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f93b2e02
Commit
f93b2e02
authored
May 05, 2019
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run rubocop -a on CE files
parent
a5620a0d
Changes
57
Show whitespace changes
Inline
Side-by-side
Showing
57 changed files
with
67 additions
and
83 deletions
+67
-83
app/controllers/help_controller.rb
app/controllers/help_controller.rb
+1
-1
app/controllers/import/bitbucket_server_controller.rb
app/controllers/import/bitbucket_server_controller.rb
+2
-2
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+1
-1
app/helpers/sidekiq_helper.rb
app/helpers/sidekiq_helper.rb
+1
-1
app/models/application_setting_implementation.rb
app/models/application_setting_implementation.rb
+1
-1
app/models/commit_range.rb
app/models/commit_range.rb
+3
-3
app/models/concerns/maskable.rb
app/models/concerns/maskable.rb
+1
-1
app/models/concerns/redactable.rb
app/models/concerns/redactable.rb
+1
-1
app/models/concerns/taskable.rb
app/models/concerns/taskable.rb
+1
-1
app/models/environment.rb
app/models/environment.rb
+2
-2
app/models/error_tracking/project_error_tracking_setting.rb
app/models/error_tracking/project_error_tracking_setting.rb
+1
-1
app/services/projects/import_error_filter.rb
app/services/projects/import_error_filter.rb
+1
-1
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+2
-2
config/initializers/gettext_rails_i18n_patch.rb
config/initializers/gettext_rails_i18n_patch.rb
+1
-1
danger/commit_messages/Dangerfile
danger/commit_messages/Dangerfile
+1
-1
db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
...131055_change_state_to_allow_empty_merge_request_diffs.rb
+0
-1
lib/api/api.rb
lib/api/api.rb
+1
-1
lib/banzai/color_parser.rb
lib/banzai/color_parser.rb
+10
-10
lib/banzai/filter/autolink_filter.rb
lib/banzai/filter/autolink_filter.rb
+1
-1
lib/banzai/filter/front_matter_filter.rb
lib/banzai/filter/front_matter_filter.rb
+1
-1
lib/banzai/filter/spaced_link_filter.rb
lib/banzai/filter/spaced_link_filter.rb
+1
-1
lib/banzai/filter/table_of_contents_filter.rb
lib/banzai/filter/table_of_contents_filter.rb
+1
-1
lib/declarative_policy/preferred_scope.rb
lib/declarative_policy/preferred_scope.rb
+0
-1
lib/gitlab.rb
lib/gitlab.rb
+2
-2
lib/gitlab/auth/result.rb
lib/gitlab/auth/result.rb
+0
-1
lib/gitlab/background_migration/populate_untracked_uploads_dependencies.rb
...ound_migration/populate_untracked_uploads_dependencies.rb
+2
-2
lib/gitlab/background_migration/prepare_untracked_uploads.rb
lib/gitlab/background_migration/prepare_untracked_uploads.rb
+1
-1
lib/gitlab/ci/build/artifacts/metadata.rb
lib/gitlab/ci/build/artifacts/metadata.rb
+2
-2
lib/gitlab/ci/pipeline/chain/command.rb
lib/gitlab/ci/pipeline/chain/command.rb
+0
-1
lib/gitlab/ci/pipeline/chain/skip.rb
lib/gitlab/ci/pipeline/chain/skip.rb
+1
-1
lib/gitlab/content_disposition.rb
lib/gitlab/content_disposition.rb
+2
-2
lib/gitlab/danger/helper.rb
lib/gitlab/danger/helper.rb
+0
-3
lib/gitlab/git/pre_receive_error.rb
lib/gitlab/git/pre_receive_error.rb
+1
-1
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+1
-1
lib/gitlab/github_import/representation/diff_note.rb
lib/gitlab/github_import/representation/diff_note.rb
+1
-1
lib/gitlab/github_import/representation/note.rb
lib/gitlab/github_import/representation/note.rb
+1
-1
lib/gitlab/health_checks/metric.rb
lib/gitlab/health_checks/metric.rb
+0
-1
lib/gitlab/health_checks/result.rb
lib/gitlab/health_checks/result.rb
+0
-1
lib/gitlab/metrics/metric.rb
lib/gitlab/metrics/metric.rb
+1
-1
lib/gitlab/middleware/read_only.rb
lib/gitlab/middleware/read_only.rb
+1
-1
lib/gitlab/middleware/release_env.rb
lib/gitlab/middleware/release_env.rb
+0
-1
lib/gitlab/push_options.rb
lib/gitlab/push_options.rb
+1
-1
lib/gitlab/quick_actions/spend_time_and_date_separator.rb
lib/gitlab/quick_actions/spend_time_and_date_separator.rb
+1
-1
lib/gitlab/sanitizers/svg.rb
lib/gitlab/sanitizers/svg.rb
+1
-1
lib/gitlab/sherlock/middleware.rb
lib/gitlab/sherlock/middleware.rb
+2
-2
lib/gitlab/sherlock/query.rb
lib/gitlab/sherlock/query.rb
+1
-1
lib/gitlab/slash_commands/result.rb
lib/gitlab/slash_commands/result.rb
+0
-1
lib/gitlab/sql/pattern.rb
lib/gitlab/sql/pattern.rb
+1
-1
lib/gitlab/user_extractor.rb
lib/gitlab/user_extractor.rb
+1
-1
lib/haml_lint/inline_javascript.rb
lib/haml_lint/inline_javascript.rb
+0
-1
lib/tasks/gemojione.rake
lib/tasks/gemojione.rake
+1
-1
qa/qa/page/project/settings/ci_cd.rb
qa/qa/page/project/settings/ci_cd.rb
+0
-1
qa/qa/runtime/key/ecdsa.rb
qa/qa/runtime/key/ecdsa.rb
+0
-1
qa/qa/runtime/key/ed25519.rb
qa/qa/runtime/key/ed25519.rb
+0
-1
rubocop/rubocop.rb
rubocop/rubocop.rb
+0
-1
spec/initializers/secret_token_spec.rb
spec/initializers/secret_token_spec.rb
+2
-2
spec/lib/gitlab/path_regex_spec.rb
spec/lib/gitlab/path_regex_spec.rb
+5
-5
No files found.
app/controllers/help_controller.rb
View file @
f93b2e02
...
...
@@ -7,7 +7,7 @@ class HelpController < ApplicationController
# Taken from Jekyll
# https://github.com/jekyll/jekyll/blob/3.5-stable/lib/jekyll/document.rb#L13
YAML_FRONT_MATTER_REGEXP
=
/\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
YAML_FRONT_MATTER_REGEXP
=
/\A(---\s*\n.*?\n?)^((---|\.\.\.)\s*$\n?)/m
.
freeze
def
index
# Remove YAML frontmatter so that it doesn't look weird
...
...
app/controllers/import/bitbucket_server_controller.rb
View file @
f93b2e02
...
...
@@ -15,8 +15,8 @@ class Import::BitbucketServerController < Import::BaseController
# (https://community.atlassian.com/t5/Answers-Developer-Questions/stash-repository-names/qaq-p/499054)
#
# Bitbucket Server starts personal project names with a tilde.
VALID_BITBUCKET_PROJECT_CHARS
=
/\A~?[\w\-\.\s]+\z/
VALID_BITBUCKET_CHARS
=
/\A[\w\-\.\s]+\z/
VALID_BITBUCKET_PROJECT_CHARS
=
/\A~?[\w\-\.\s]+\z/
.
freeze
VALID_BITBUCKET_CHARS
=
/\A[\w\-\.\s]+\z/
.
freeze
def
new
end
...
...
app/helpers/auth_helper.rb
View file @
f93b2e02
...
...
@@ -2,7 +2,7 @@
module
AuthHelper
PROVIDERS_WITH_ICONS
=
%w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq)
.
freeze
LDAP_PROVIDER
=
/\Aldap/
LDAP_PROVIDER
=
/\Aldap/
.
freeze
def
ldap_enabled?
Gitlab
::
Auth
::
LDAP
::
Config
.
enabled?
...
...
app/helpers/sidekiq_helper.rb
View file @
f93b2e02
...
...
@@ -8,7 +8,7 @@ module SidekiqHelper
(?<state>[DIEKNRSTVWXZNLpsl
\+
<>/
\d
]+)
\s
+
(?<start>.+?)
\s
+
(?<command>(?:ruby
\d
+:
\s
+)?sidekiq.*
\]
.*)
\z
}x
\z
}x
.
freeze
def
parse_sidekiq_ps
(
line
)
match
=
line
.
strip
.
match
(
SIDEKIQ_PS_REGEXP
)
...
...
app/models/application_setting_implementation.rb
View file @
f93b2e02
...
...
@@ -8,7 +8,7 @@ module ApplicationSettingImplementation
\s
# any whitespace character
| # or
[
\r\n
] # any number of newline characters
}x
}x
.
freeze
# Setting a key restriction to `-1` means that all keys of this type are
# forbidden.
...
...
app/models/commit_range.rb
View file @
f93b2e02
...
...
@@ -28,12 +28,12 @@ class CommitRange
# The beginning and ending refs can be named or SHAs, and
# the range notation can be double- or triple-dot.
REF_PATTERN
=
/[0-9a-zA-Z][0-9a-zA-Z_.-]*[0-9a-zA-Z\^]/
PATTERN
=
/
#{
REF_PATTERN
}
\.{2,3}
#{
REF_PATTERN
}
/
REF_PATTERN
=
/[0-9a-zA-Z][0-9a-zA-Z_.-]*[0-9a-zA-Z\^]/
.
freeze
PATTERN
=
/
#{
REF_PATTERN
}
\.{2,3}
#{
REF_PATTERN
}
/
.
freeze
# In text references, the beginning and ending refs can only be SHAs
# between 7 and 40 hex characters.
STRICT_PATTERN
=
/\h{7,40}\.{2,3}\h{7,40}/
STRICT_PATTERN
=
/\h{7,40}\.{2,3}\h{7,40}/
.
freeze
def
self
.
reference_prefix
'@'
...
...
app/models/concerns/maskable.rb
View file @
f93b2e02
...
...
@@ -9,7 +9,7 @@ module Maskable
# * No spaces
# * Minimal length of 8 characters
# * Absolutely no fun is allowed
REGEX
=
/\A\w{8,}\z/
REGEX
=
/\A\w{8,}\z/
.
freeze
included
do
validates
:masked
,
inclusion:
{
in:
[
true
,
false
]
}
...
...
app/models/concerns/redactable.rb
View file @
f93b2e02
...
...
@@ -10,7 +10,7 @@
module
Redactable
extend
ActiveSupport
::
Concern
UNSUBSCRIBE_PATTERN
=
%r{/sent_notifications/
\h
{32}/unsubscribe}
UNSUBSCRIBE_PATTERN
=
%r{/sent_notifications/
\h
{32}/unsubscribe}
.
freeze
class_methods
do
def
redact_field
(
field
)
...
...
app/models/concerns/taskable.rb
View file @
f93b2e02
...
...
@@ -19,7 +19,7 @@ module Taskable
\s
+ # whitespace prefix has to be always presented for a list item
(
\[\s\]
|
\[
[xX]
\]
) # checkbox
(
\s
.+) # followed by whitespace and some text.
}x
}x
.
freeze
def
self
.
get_tasks
(
content
)
content
.
to_s
.
scan
(
ITEM_PATTERN
).
map
do
|
checkbox
,
label
|
...
...
app/models/environment.rb
View file @
f93b2e02
...
...
@@ -3,8 +3,8 @@
class
Environment
<
ApplicationRecord
include
Gitlab
::
Utils
::
StrongMemoize
# Used to generate random suffixes for the slug
LETTERS
=
'a'
..
'z'
NUMBERS
=
'0'
..
'9'
LETTERS
=
(
'a'
..
'z'
).
freeze
NUMBERS
=
(
'0'
..
'9'
).
freeze
SUFFIX_CHARS
=
LETTERS
.
to_a
+
NUMBERS
.
to_a
belongs_to
:project
,
required:
true
...
...
app/models/error_tracking/project_error_tracking_setting.rb
View file @
f93b2e02
...
...
@@ -16,7 +16,7 @@ module ErrorTracking
(?<project>[^/]+)/*
)?
\z
}x
}x
.
freeze
self
.
reactive_cache_key
=
->
(
setting
)
{
[
setting
.
class
.
model_name
.
singular
,
setting
.
project_id
]
}
...
...
app/services/projects/import_error_filter.rb
View file @
f93b2e02
...
...
@@ -4,7 +4,7 @@ module Projects
# Used by project imports, it removes any potential paths
# included in an error message that could be stored in the DB
class
ImportErrorFilter
ERROR_MESSAGE_FILTER
=
/[^\s]*
#{
File
::
SEPARATOR
}
[^\s]*(?=(\s|\z))/
ERROR_MESSAGE_FILTER
=
/[^\s]*
#{
File
::
SEPARATOR
}
[^\s]*(?=(\s|\z))/
.
freeze
FILTER_MESSAGE
=
'[FILTERED]'
def
self
.
filter_message
(
message
)
...
...
app/uploaders/file_uploader.rb
View file @
f93b2e02
...
...
@@ -14,8 +14,8 @@ class FileUploader < GitlabUploader
include
ObjectStorage
::
Concern
prepend
ObjectStorage
::
Extension
::
RecordsUploads
MARKDOWN_PATTERN
=
%r{
\!
?
\[
.*?
\]\(
/uploads/(?<secret>[0-9a-f]{32})/(?<file>.*?)
\)
}
DYNAMIC_PATH_PATTERN
=
%r{.*(?<secret>
\h
{32})/(?<identifier>.*)}
MARKDOWN_PATTERN
=
%r{
\!
?
\[
.*?
\]\(
/uploads/(?<secret>[0-9a-f]{32})/(?<file>.*?)
\)
}
.
freeze
DYNAMIC_PATH_PATTERN
=
%r{.*(?<secret>
\h
{32})/(?<identifier>.*)}
.
freeze
after
:remove
,
:prune_store_dir
...
...
config/initializers/gettext_rails_i18n_patch.rb
View file @
f93b2e02
...
...
@@ -2,7 +2,7 @@ require 'gettext_i18n_rails/haml_parser'
require
'gettext_i18n_rails_js/parser/javascript'
require
'json'
VUE_TRANSLATE_REGEX
=
/((%[\w.-]+)(?:\s))?{{ (N|n|s)?__\((.*)\) }}/
VUE_TRANSLATE_REGEX
=
/((%[\w.-]+)(?:\s))?{{ (N|n|s)?__\((.*)\) }}/
.
freeze
module
GettextI18nRails
class
HamlParser
...
...
danger/commit_messages/Dangerfile
View file @
f93b2e02
...
...
@@ -21,7 +21,7 @@ class EmojiChecker
# alone is not enough, as we'd match `:foo:bar:baz`. Instead, we use this
# regex to save us from having to check for all possible emoji names when we
# know one definitely is not included.
LIKELY_EMOJI
=
/:[\+a-z0-9_\-]+:/
LIKELY_EMOJI
=
/:[\+a-z0-9_\-]+:/
.
freeze
def
initialize
names
=
JSON
.
parse
(
File
.
read
(
DIGESTS
)).
keys
+
...
...
db/migrate/20140414131055_change_state_to_allow_empty_merge_request_diffs.rb
View file @
f93b2e02
# rubocop:disable all
class
ChangeStateToAllowEmptyMergeRequestDiffs
<
ActiveRecord
::
Migration
[
4.2
]
def
up
change_column
:merge_request_diffs
,
:state
,
:string
,
null:
true
,
...
...
lib/api/api.rb
View file @
f93b2e02
...
...
@@ -6,7 +6,7 @@ module API
LOG_FILENAME
=
Rails
.
root
.
join
(
"log"
,
"api_json.log"
)
NO_SLASH_URL_PART_REGEX
=
%r{[^/]+}
NO_SLASH_URL_PART_REGEX
=
%r{[^/]+}
.
freeze
NAMESPACE_OR_PROJECT_REQUIREMENTS
=
{
id:
NO_SLASH_URL_PART_REGEX
}.
freeze
COMMIT_ENDPOINT_REQUIREMENTS
=
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
sha:
NO_SLASH_URL_PART_REGEX
).
freeze
USER_REQUIREMENTS
=
{
user_id:
NO_SLASH_URL_PART_REGEX
}.
freeze
...
...
lib/banzai/color_parser.rb
View file @
f93b2e02
...
...
@@ -2,13 +2,13 @@
module
Banzai
module
ColorParser
ALPHA
=
/0(?:\.\d+)?|\.\d+|1(?:\.0+)?/
# 0.0..1.0
PERCENTS
=
/(?:\d{1,2}|100)%/
# 00%..100%
ALPHA_CHANNEL
=
/(?:,\s*(?:
#{
ALPHA
}
|
#{
PERCENTS
}
))?/
BITS
=
/\d{1,2}|1\d\d|2(?:[0-4]\d|5[0-5])/
# 00..255
DEGS
=
/-?\d+(?:deg)?/i
# [-]digits[deg]
RADS
=
/-?(?:\d+(?:\.\d+)?|\.\d+)rad/i
# [-](digits[.digits] OR .digits)rad
HEX_FORMAT
=
/\#(?:\h{3}|\h{4}|\h{6}|\h{8})/
ALPHA
=
/0(?:\.\d+)?|\.\d+|1(?:\.0+)?/
.
freeze
# 0.0..1.0
PERCENTS
=
/(?:\d{1,2}|100)%/
.
freeze
# 00%..100%
ALPHA_CHANNEL
=
/(?:,\s*(?:
#{
ALPHA
}
|
#{
PERCENTS
}
))?/
.
freeze
BITS
=
/\d{1,2}|1\d\d|2(?:[0-4]\d|5[0-5])/
.
freeze
# 00..255
DEGS
=
/-?\d+(?:deg)?/i
.
freeze
# [-]digits[deg]
RADS
=
/-?(?:\d+(?:\.\d+)?|\.\d+)rad/i
.
freeze
# [-](digits[.digits] OR .digits)rad
HEX_FORMAT
=
/\#(?:\h{3}|\h{4}|\h{6}|\h{8})/
.
freeze
RGB_FORMAT
=
%r{
(?:rgba?
\(
...
...
@@ -20,7 +20,7 @@ module Banzai
#{
ALPHA_CHANNEL
}
\)
)
}xi
}xi
.
freeze
HSL_FORMAT
=
%r{
(?:hsla?
\(
...
...
@@ -28,11 +28,11 @@ module Banzai
#{
ALPHA_CHANNEL
}
\)
)
}xi
}xi
.
freeze
FORMATS
=
[
HEX_FORMAT
,
RGB_FORMAT
,
HSL_FORMAT
].
freeze
COLOR_FORMAT
=
/\A(
#{
Regexp
.
union
(
FORMATS
)
}
)\z/ix
COLOR_FORMAT
=
/\A(
#{
Regexp
.
union
(
FORMATS
)
}
)\z/ix
.
freeze
# Public: Analyzes whether the String is a color code.
#
...
...
lib/banzai/filter/autolink_filter.rb
View file @
f93b2e02
...
...
@@ -33,7 +33,7 @@ module Banzai
# https://github.com/vmg/rinku/blob/v2.0.1/ext/rinku/autolink.c#L65
#
# Rubular: http://rubular.com/r/nrL3r9yUiq
LINK_PATTERN
=
%r{([a-z][a-z0-9
\+\.
-]+://[^
\s
>]+)(?<!
\?
|!|
\.
|,|:)}
LINK_PATTERN
=
%r{([a-z][a-z0-9
\+\.
-]+://[^
\s
>]+)(?<!
\?
|!|
\.
|,|:)}
.
freeze
# Text matching LINK_PATTERN inside these elements will not be linked
IGNORE_PARENTS
=
%w(a code kbd pre script style)
.
to_set
...
...
lib/banzai/filter/front_matter_filter.rb
View file @
f93b2e02
...
...
@@ -20,7 +20,7 @@ module Banzai
\s
*
^
\k
<delim> # closing front matter marker
\s
*
}mx
}mx
.
freeze
def
call
html
.
sub
(
PATTERN
)
do
|
_match
|
...
...
lib/banzai/filter/spaced_link_filter.rb
View file @
f93b2e02
...
...
@@ -33,7 +33,7 @@ module Banzai
(?<new_link>.+?)
(?<title>
\
".+?")?
\)
}x
}x
.
freeze
# Text matching LINK_OR_IMAGE_PATTERN inside these elements will not be linked
IGNORE_PARENTS
=
%w(a code kbd pre script style)
.
to_set
...
...
lib/banzai/filter/table_of_contents_filter.rb
View file @
f93b2e02
...
...
@@ -17,7 +17,7 @@ module Banzai
# :toc - String containing Table of Contents data as a `ul` element with
# `li` child elements.
class
TableOfContentsFilter
<
HTML
::
Pipeline
::
Filter
PUNCTUATION_REGEXP
=
/[^\p{Word}\- ]/u
PUNCTUATION_REGEXP
=
/[^\p{Word}\- ]/u
.
freeze
def
call
return
doc
if
context
[
:no_header_anchors
]
...
...
lib/declarative_policy/preferred_scope.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
DeclarativePolicy
...
...
lib/gitlab.rb
View file @
f93b2e02
...
...
@@ -36,8 +36,8 @@ module Gitlab
end
COM_URL
=
'https://gitlab.com'
.
freeze
APP_DIRS_PATTERN
=
%r{^/?(app|config|ee|lib|spec|
\(\w
*
\)
)}
SUBDOMAIN_REGEX
=
%r{
\A
https://[a-z0-9]+
\.
gitlab
\.
com
\z
}
APP_DIRS_PATTERN
=
%r{^/?(app|config|ee|lib|spec|
\(\w
*
\)
)}
.
freeze
SUBDOMAIN_REGEX
=
%r{
\A
https://[a-z0-9]+
\.
gitlab
\.
com
\z
}
.
freeze
VERSION
=
File
.
read
(
root
.
join
(
"VERSION"
)).
strip
.
freeze
INSTALLATION_TYPE
=
File
.
read
(
root
.
join
(
"INSTALLATION_TYPE"
)).
strip
.
freeze
...
...
lib/gitlab/auth/result.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab
...
...
lib/gitlab/background_migration/populate_untracked_uploads_dependencies.rb
View file @
f93b2e02
...
...
@@ -8,8 +8,8 @@ module Gitlab
self
.
table_name
=
'untracked_files_for_uploads'
# Ends with /:random_hex/:filename
FILE_UPLOADER_PATH
=
%r{/
\h
+/[^/]+
\z
}
FULL_PATH_CAPTURE
=
/\A(.+)
#{
FILE_UPLOADER_PATH
}
/
FILE_UPLOADER_PATH
=
%r{/
\h
+/[^/]+
\z
}
.
freeze
FULL_PATH_CAPTURE
=
/\A(.+)
#{
FILE_UPLOADER_PATH
}
/
.
freeze
# These regex patterns are tested against a relative path, relative to
# the upload directory.
...
...
lib/gitlab/background_migration/prepare_untracked_uploads.rb
View file @
f93b2e02
...
...
@@ -16,7 +16,7 @@ module Gitlab
RELATIVE_UPLOAD_DIR
)
FOLLOW_UP_MIGRATION
=
'PopulateUntrackedUploads'
.
freeze
START_WITH_ROOT_REGEX
=
%r{
\A
#{
Gitlab
.
config
.
uploads
.
storage_path
}
/}
START_WITH_ROOT_REGEX
=
%r{
\A
#{
Gitlab
.
config
.
uploads
.
storage_path
}
/}
.
freeze
EXCLUDED_HASHED_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/@hashed/*"
.
freeze
EXCLUDED_TMP_UPLOADS_PATH
=
"
#{
ABSOLUTE_UPLOAD_DIR
}
/tmp/*"
.
freeze
...
...
lib/gitlab/ci/build/artifacts/metadata.rb
View file @
f93b2e02
...
...
@@ -11,8 +11,8 @@ module Gitlab
ParserError
=
Class
.
new
(
StandardError
)
InvalidStreamError
=
Class
.
new
(
StandardError
)
VERSION_PATTERN
=
/^[\w\s]+(\d+\.\d+\.\d+)/
INVALID_PATH_PATTERN
=
%r{(^
\.
?
\.
?/)|(/
\.
?
\.
?/)}
VERSION_PATTERN
=
/^[\w\s]+(\d+\.\d+\.\d+)/
.
freeze
INVALID_PATH_PATTERN
=
%r{(^
\.
?
\.
?/)|(/
\.
?
\.
?/)}
.
freeze
attr_reader
:stream
,
:path
,
:full_version
...
...
lib/gitlab/ci/pipeline/chain/command.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab
...
...
lib/gitlab/ci/pipeline/chain/skip.rb
View file @
f93b2e02
...
...
@@ -7,7 +7,7 @@ module Gitlab
class
Skip
<
Chain
::
Base
include
::
Gitlab
::
Utils
::
StrongMemoize
SKIP_PATTERN
=
/\[(ci[ _-]skip|skip[ _-]ci)\]/i
SKIP_PATTERN
=
/\[(ci[ _-]skip|skip[ _-]ci)\]/i
.
freeze
def
perform!
if
skipped?
...
...
lib/gitlab/content_disposition.rb
View file @
f93b2e02
...
...
@@ -22,13 +22,13 @@ module Gitlab
end
# rubocop:disable Style/VariableInterpolation
TRADITIONAL_ESCAPED_CHAR
=
/[^ A-Za-z0-9!#$+.^_`|~-]/
TRADITIONAL_ESCAPED_CHAR
=
/[^ A-Za-z0-9!#$+.^_`|~-]/
.
freeze
def
ascii_filename
'filename="'
+
percent_escape
(
::
I18n
.
transliterate
(
filename
),
TRADITIONAL_ESCAPED_CHAR
)
+
'"'
end
RFC_5987_ESCAPED_CHAR
=
/[^A-Za-z0-9!#$&+.^_`|~-]/
RFC_5987_ESCAPED_CHAR
=
/[^A-Za-z0-9!#$&+.^_`|~-]/
.
freeze
# rubocop:enable Style/VariableInterpolation
def
utf8_filename
...
...
lib/gitlab/danger/helper.rb
View file @
f93b2e02
...
...
@@ -103,8 +103,6 @@ module Gitlab
none:
""
,
qa:
"~QA"
}.
freeze
# rubocop:disable Style/RegexpLiteral
CATEGORIES
=
{
%r{
\A
doc/}
=>
:none
,
# To reinstate roulette for documentation, set to `:docs`.
%r{
\A
(CONTRIBUTING|LICENSE|MAINTENANCE|PHILOSOPHY|PROCESS|README)(
\.
md)?
\z
}
=>
:none
,
# To reinstate roulette for documentation, set to `:docs`.
...
...
@@ -151,7 +149,6 @@ module Gitlab
%r{
\.
(md|txt)
\z
}
=>
:none
,
# To reinstate roulette for documentation, set to `:docs`.
%r{
\.
js
\z
}
=>
:frontend
}.
freeze
# rubocop:enable Style/RegexpLiteral
end
end
end
lib/gitlab/git/pre_receive_error.rb
View file @
f93b2e02
...
...
@@ -14,7 +14,7 @@ module Gitlab
'GL-HOOK-ERR:'
# Messages marked as safe by user
].
freeze
SAFE_MESSAGE_REGEX
=
/^(
#{
SAFE_MESSAGE_PREFIXES
.
join
(
'|'
)
}
)\s*(?<safe_message>.+)/
SAFE_MESSAGE_REGEX
=
/^(
#{
SAFE_MESSAGE_PREFIXES
.
join
(
'|'
)
}
)\s*(?<safe_message>.+)/
.
freeze
def
initialize
(
message
=
''
)
super
(
sanitize
(
message
))
...
...
lib/gitlab/gitaly_client.rb
View file @
f93b2e02
...
...
@@ -26,7 +26,7 @@ module Gitlab
end
end
PEM_REGEX
=
/\-+BEGIN CERTIFICATE\-+.+?\-+END CERTIFICATE\-+/m
PEM_REGEX
=
/\-+BEGIN CERTIFICATE\-+.+?\-+END CERTIFICATE\-+/m
.
freeze
SERVER_VERSION_FILE
=
'GITALY_SERVER_VERSION'
MAXIMUM_GITALY_CALLS
=
30
CLIENT_NAME
=
(
Sidekiq
.
server?
?
'gitlab-sidekiq'
:
'gitlab-web'
).
freeze
...
...
lib/gitlab/github_import/representation/diff_note.rb
View file @
f93b2e02
...
...
@@ -13,7 +13,7 @@ module Gitlab
:diff_hunk
,
:author
,
:note
,
:created_at
,
:updated_at
,
:github_id
NOTEABLE_ID_REGEX
=
%r{/pull/(?<iid>
\d
+)}i
NOTEABLE_ID_REGEX
=
%r{/pull/(?<iid>
\d
+)}i
.
freeze
# Builds a diff note from a GitHub API response.
#
...
...
lib/gitlab/github_import/representation/note.rb
View file @
f93b2e02
...
...
@@ -12,7 +12,7 @@ module Gitlab
expose_attribute
:noteable_id
,
:noteable_type
,
:author
,
:note
,
:created_at
,
:updated_at
,
:github_id
NOTEABLE_TYPE_REGEX
=
%r{/(?<type>(pull|issues))/(?<iid>
\d
+)}i
NOTEABLE_TYPE_REGEX
=
%r{/(?<type>(pull|issues))/(?<iid>
\d
+)}i
.
freeze
# Builds a note from a GitHub API response.
#
...
...
lib/gitlab/health_checks/metric.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab::HealthChecks
...
...
lib/gitlab/health_checks/result.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab::HealthChecks
...
...
lib/gitlab/metrics/metric.rb
View file @
f93b2e02
...
...
@@ -4,7 +4,7 @@ module Gitlab
module
Metrics
# Class for storing details of a single metric (label, value, etc).
class
Metric
JITTER_RANGE
=
0.000001
..
0.001
JITTER_RANGE
=
(
0.000001
..
0.001
).
freeze
attr_reader
:series
,
:values
,
:tags
,
:type
...
...
lib/gitlab/middleware/read_only.rb
View file @
f93b2e02
...
...
@@ -3,7 +3,7 @@
module
Gitlab
module
Middleware
class
ReadOnly
API_VERSIONS
=
(
3
..
4
)
API_VERSIONS
=
(
3
..
4
)
.
freeze
def
self
.
internal_routes
@internal_routes
||=
...
...
lib/gitlab/middleware/release_env.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab
...
...
lib/gitlab/push_options.rb
View file @
f93b2e02
...
...
@@ -15,7 +15,7 @@ module Gitlab
mr: :merge_request
}).
freeze
OPTION_MATCHER
=
/(?<namespace>[^\.]+)\.(?<key>[^=]+)=?(?<value>.*)/
OPTION_MATCHER
=
/(?<namespace>[^\.]+)\.(?<key>[^=]+)=?(?<value>.*)/
.
freeze
attr_reader
:options
...
...
lib/gitlab/quick_actions/spend_time_and_date_separator.rb
View file @
f93b2e02
...
...
@@ -11,7 +11,7 @@ module Gitlab
# if date doesn't present return time with current date
# in other cases return nil
class
SpendTimeAndDateSeparator
DATE_REGEX
=
%r{(
\d
{2,4}[/
\-
.]
\d
{1,2}[/
\-
.]
\d
{1,2})}
DATE_REGEX
=
%r{(
\d
{2,4}[/
\-
.]
\d
{1,2}[/
\-
.]
\d
{1,2})}
.
freeze
def
initialize
(
spend_command_arg
)
@spend_arg
=
spend_command_arg
...
...
lib/gitlab/sanitizers/svg.rb
View file @
f93b2e02
...
...
@@ -9,7 +9,7 @@ module Gitlab
class
Scrubber
<
Loofah
::
Scrubber
# http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes
DATA_ATTR_PATTERN
=
/\Adata-(?!xml)[a-z_][\w.\u00E0-\u00F6\u00F8-\u017F\u01DD-\u02AF-]*\z/u
DATA_ATTR_PATTERN
=
/\Adata-(?!xml)[a-z_][\w.\u00E0-\u00F6\u00F8-\u017F\u01DD-\u02AF-]*\z/u
.
freeze
def
scrub
(
node
)
unless
Whitelist
::
ALLOWED_ELEMENTS
.
include?
(
node
.
name
)
...
...
lib/gitlab/sherlock/middleware.rb
View file @
f93b2e02
...
...
@@ -4,9 +4,9 @@ module Gitlab
module
Sherlock
# Rack middleware used for tracking request metrics.
class
Middleware
CONTENT_TYPES
=
%r{text/html|application/json}i
CONTENT_TYPES
=
%r{text/html|application/json}i
.
freeze
IGNORE_PATHS
=
%r{^/sherlock}
IGNORE_PATHS
=
%r{^/sherlock}
.
freeze
def
initialize
(
app
)
@app
=
app
...
...
lib/gitlab/sherlock/query.rb
View file @
f93b2e02
...
...
@@ -15,7 +15,7 @@ module Gitlab
|GROUP
\s
+BY
|ORDER
\s
+BY
|LIMIT
|OFFSET)
\s
+}ix
# Vim indent breaks when this is on a newline :<
|OFFSET)
\s
+}ix
.
freeze
# Vim indent breaks when this is on a newline :<
# Creates a new Query using a String and a separate Array of bindings.
#
...
...
lib/gitlab/slash_commands/result.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
Gitlab
...
...
lib/gitlab/sql/pattern.rb
View file @
f93b2e02
...
...
@@ -6,7 +6,7 @@ module Gitlab
extend
ActiveSupport
::
Concern
MIN_CHARS_FOR_PARTIAL_MATCHING
=
3
REGEX_QUOTED_WORD
=
/(?<=\A| )"[^"]+"(?= |\z)/
REGEX_QUOTED_WORD
=
/(?<=\A| )"[^"]+"(?= |\z)/
.
freeze
class_methods
do
def
fuzzy_search
(
query
,
columns
)
...
...
lib/gitlab/user_extractor.rb
View file @
f93b2e02
...
...
@@ -7,7 +7,7 @@ module Gitlab
class
UserExtractor
# Not using `Devise.email_regexp` to filter out any chars that an email
# does not end with and not pinning the email to a start of end of a string.
EMAIL_REGEXP
=
/(?<email>([^@\s]+@[^@\s]+(?<!\W)))/
EMAIL_REGEXP
=
/(?<email>([^@\s]+@[^@\s]+(?<!\W)))/
.
freeze
USERNAME_REGEXP
=
User
.
reference_pattern
def
initialize
(
text
)
...
...
lib/haml_lint/inline_javascript.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
unless
Rails
.
env
.
production?
...
...
lib/tasks/gemojione.rake
View file @
f93b2e02
...
...
@@ -209,7 +209,7 @@ namespace :gemojione do
image
.
destroy!
end
EMOJI_IMAGE_PATH_RE
=
/(.*?)(([0-9a-f]-?)+)\.png$/i
EMOJI_IMAGE_PATH_RE
=
/(.*?)(([0-9a-f]-?)+)\.png$/i
.
freeze
def
rename_to_named_emoji_image!
(
emoji_unicode_string_to_name_map
,
image_path
)
# Rename file from unicode to emoji name
matches
=
EMOJI_IMAGE_PATH_RE
.
match
(
image_path
)
...
...
qa/qa/page/project/settings/ci_cd.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
QA
...
...
qa/qa/runtime/key/ecdsa.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
QA
...
...
qa/qa/runtime/key/ed25519.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
# frozen_string_literal: true
module
QA
...
...
rubocop/rubocop.rb
View file @
f93b2e02
# rubocop:disable Naming/FileName
require_relative
'cop/gitlab/module_with_instance_variables'
require_relative
'cop/gitlab/predicate_memoization'
require_relative
'cop/gitlab/httparty'
...
...
spec/initializers/secret_token_spec.rb
View file @
f93b2e02
...
...
@@ -6,8 +6,8 @@ describe 'create_tokens' do
let
(
:secrets
)
{
ActiveSupport
::
OrderedOptions
.
new
}
HEX_KEY
=
/\h{128}/
RSA_KEY
=
/\A-----BEGIN RSA PRIVATE KEY-----\n.+\n-----END RSA PRIVATE KEY-----\n\Z/m
HEX_KEY
=
/\h{128}/
.
freeze
RSA_KEY
=
/\A-----BEGIN RSA PRIVATE KEY-----\n.+\n-----END RSA PRIVATE KEY-----\n\Z/m
.
freeze
before
do
allow
(
File
).
to
receive
(
:write
)
...
...
spec/lib/gitlab/path_regex_spec.rb
View file @
f93b2e02
...
...
@@ -120,10 +120,10 @@ describe Gitlab::PathRegex do
# - Followed by one or more path-parts not starting with `:` or `*`
# - Followed by a path-part that includes a wildcard parameter `*`
# At the time of writing these routes match: http://rubular.com/r/Rv2pDE5Dvw
STARTING_WITH_NAMESPACE
=
%r{^/
\*
namespace_id/:(project_)?id}
NON_PARAM_PARTS
=
%r{[^:*][a-z
\-
_/]*}
ANY_OTHER_PATH_PART
=
%r{[a-z
\-
_/:]*}
WILDCARD_SEGMENT
=
/\*/
STARTING_WITH_NAMESPACE
=
%r{^/
\*
namespace_id/:(project_)?id}
.
freeze
NON_PARAM_PARTS
=
%r{[^:*][a-z
\-
_/]*}
.
freeze
ANY_OTHER_PATH_PART
=
%r{[a-z
\-
_/:]*}
.
freeze
WILDCARD_SEGMENT
=
/\*/
.
freeze
let
(
:namespaced_wildcard_routes
)
do
routes_without_format
.
select
do
|
p
|
p
=~
%r{
#{
STARTING_WITH_NAMESPACE
}
/
#{
NON_PARAM_PARTS
}
/
#{
ANY_OTHER_PATH_PART
}#{
WILDCARD_SEGMENT
}
}
...
...
@@ -144,7 +144,7 @@ describe Gitlab::PathRegex do
end
.
uniq
end
STARTING_WITH_GROUP
=
%r{^/groups/
\*
(group_)?id/}
STARTING_WITH_GROUP
=
%r{^/groups/
\*
(group_)?id/}
.
freeze
let
(
:group_routes
)
do
routes_without_format
.
select
do
|
path
|
path
=~
STARTING_WITH_GROUP
...
...
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