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
a173249e
Commit
a173249e
authored
Jul 02, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve Style/RegexpLiteralMixedPreserve part1
- resolve todo items.
parent
965bb0d6
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
14 additions
and
25 deletions
+14
-25
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-11
app/controllers/projects/repositories_controller.rb
app/controllers/projects/repositories_controller.rb
+1
-1
app/helpers/ci/variables_helper.rb
app/helpers/ci/variables_helper.rb
+1
-1
app/models/alert_management/alert.rb
app/models/alert_management/alert.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+2
-2
app/models/blob_viewer/go_mod.rb
app/models/blob_viewer/go_mod.rb
+3
-3
app/models/concerns/ci/maskable.rb
app/models/concerns/ci/maskable.rb
+1
-1
app/models/operations/feature_flag.rb
app/models/operations/feature_flag.rb
+1
-1
app/models/packages/go/module.rb
app/models/packages/go/module.rb
+1
-1
app/services/packages/conan/search_service.rb
app/services/packages/conan/search_service.rb
+1
-1
app/services/projects/update_remote_mirror_service.rb
app/services/projects/update_remote_mirror_service.rb
+1
-1
config/initializers/rspec_profiling.rb
config/initializers/rspec_profiling.rb
+1
-1
No files found.
.rubocop_manual_todo.yml
View file @
a173249e
...
...
@@ -2444,17 +2444,6 @@ Gitlab/FeatureAvailableUsage:
# WIP See https://gitlab.com/gitlab-org/gitlab/-/issues/327490
Style/RegexpLiteralMixedPreserve
:
Exclude
:
-
'
app/controllers/projects/repositories_controller.rb'
-
'
app/helpers/ci/variables_helper.rb'
-
'
app/models/alert_management/alert.rb'
-
'
app/models/application_setting.rb'
-
'
app/models/blob_viewer/go_mod.rb'
-
'
app/models/concerns/ci/maskable.rb'
-
'
app/models/operations/feature_flag.rb'
-
'
app/models/packages/go/module.rb'
-
'
app/services/packages/conan/search_service.rb'
-
'
app/services/projects/update_remote_mirror_service.rb'
-
'
config/initializers/rspec_profiling.rb'
-
'
ee/app/models/status_page/project_setting.rb'
-
'
ee/app/presenters/vulnerability_presenter.rb'
-
'
ee/lib/api/geo_nodes.rb'
...
...
app/controllers/projects/repositories_controller.rb
View file @
a173249e
...
...
@@ -117,7 +117,7 @@ class Projects::RepositoriesController < Projects::ApplicationController
# from Redis.
def
extract_ref_and_filename
(
id
)
path
=
id
.
strip
data
=
path
.
match
(
/(.*)\/(.*)/
)
data
=
path
.
match
(
%r{(.*)/(.*)}
)
if
data
[
data
[
1
],
data
[
2
]]
...
...
app/helpers/ci/variables_helper.rb
View file @
a173249e
...
...
@@ -48,7 +48,7 @@ module Ci
end
def
ci_variable_maskable_regex
Ci
::
Maskable
::
REGEX
.
inspect
.
sub
(
'\\A'
,
'^'
).
sub
(
'\\z'
,
'$'
).
sub
(
/^\//
,
''
).
sub
(
/\/[a-z]*$/
,
''
).
gsub
(
'\/'
,
'/'
)
Ci
::
Maskable
::
REGEX
.
inspect
.
sub
(
'\\A'
,
'^'
).
sub
(
'\\z'
,
'$'
).
sub
(
%r{^/}
,
''
).
sub
(
%r{/[a-z]*$}
,
''
).
gsub
(
'\/'
,
'/'
)
end
end
end
app/models/alert_management/alert.rb
View file @
a173249e
...
...
@@ -210,7 +210,7 @@ module AlertManagement
end
def
self
.
link_reference_pattern
@link_reference_pattern
||=
super
(
"alert_management"
,
/(?<alert>\d+)\/details(\#)?/
)
@link_reference_pattern
||=
super
(
"alert_management"
,
%r{(?<alert>
\d
+)/details(
\#
)?}
)
end
def
self
.
reference_valid?
(
reference
)
...
...
app/models/application_setting.rb
View file @
a173249e
...
...
@@ -293,7 +293,7 @@ class ApplicationSetting < ApplicationRecord
validates
:user_default_internal_regex
,
js_regex:
true
,
allow_nil:
true
validates
:personal_access_token_prefix
,
format:
{
with:
/\A[a-zA-Z0-9_+=\/@:.-]+\z/
,
format:
{
with:
%r{
\A
[a-zA-Z0-9_+=/@:.-]+
\z
}
,
message:
_
(
"can contain only letters of the Base64 alphabet (RFC4648) with the addition of '@', ':' and '.'"
)
},
length:
{
maximum:
20
,
message:
_
(
'is too long (maximum is %{count} characters)'
)
},
allow_blank:
true
...
...
@@ -590,7 +590,7 @@ class ApplicationSetting < ApplicationRecord
end
def
sourcegraph_url_is_com?
!!
(
sourcegraph_url
=~
/\Ahttps:\/\/(www\.)?sourcegraph\.com/
)
!!
(
sourcegraph_url
=~
%r{
\A
https://(www
\.
)?sourcegraph
\.
com}
)
end
def
instance_review_permitted?
...
...
app/models/blob_viewer/go_mod.rb
View file @
a173249e
...
...
@@ -5,13 +5,13 @@ module BlobViewer
include
ServerSide
include
Gitlab
::
Utils
::
StrongMemoize
MODULE_REGEX
=
/
MODULE_REGEX
=
%r{
\A
(?# beginning of file)
module
\s
+ (?# module directive)
(?<name>.*?) (?# module name)
\s*(?:
\/\
/.*)? (?# comment)
\s
*(?:
/
/.*)? (?# comment)
(?:
\n
|
\z
) (?# newline or end of file)
/
x
.
freeze
}
x
.
freeze
self
.
file_types
=
%i(go_mod go_sum)
...
...
app/models/concerns/ci/maskable.rb
View file @
a173249e
...
...
@@ -11,7 +11,7 @@ module Ci
# * Minimal length of 8 characters
# * Characters must be from the Base64 alphabet (RFC4648) with the addition of '@', ':', '.', and '~'
# * Absolutely no fun is allowed
REGEX
=
/\A[a-zA-Z0-9_+=\/@:.~-]{8,}\z/
.
freeze
REGEX
=
%r{
\A
[a-zA-Z0-9_+=/@:.~-]{8,}
\z
}
.
freeze
included
do
validates
:masked
,
inclusion:
{
in:
[
true
,
false
]
}
...
...
app/models/operations/feature_flag.rb
View file @
a173249e
...
...
@@ -80,7 +80,7 @@ module Operations
end
def
link_reference_pattern
@link_reference_pattern
||=
super
(
"feature_flags"
,
/(?<feature_flag>\d+)\/edit/
)
@link_reference_pattern
||=
super
(
"feature_flags"
,
%r{(?<feature_flag>
\d
+)/edit}
)
end
def
reference_postfix
...
...
app/models/packages/go/module.rb
View file @
a173249e
...
...
@@ -33,7 +33,7 @@ module Packages
end
def
path_valid?
(
major
)
m
=
/\/v(\d+)$/
i
.
match
(
@name
)
m
=
%r{/v(
\d
+)$}
i
.
match
(
@name
)
case
major
when
0
,
1
...
...
app/services/packages/conan/search_service.rb
View file @
a173249e
...
...
@@ -41,7 +41,7 @@ module Packages
end
def
search_for_single_package
(
query
)
name
,
version
,
username
,
_
=
query
.
split
(
/[@\/]/
)
name
,
version
,
username
,
_
=
query
.
split
(
%r{[@/]}
)
full_path
=
Packages
::
Conan
::
Metadatum
.
full_path_from
(
package_username:
username
)
project
=
Project
.
find_by_full_path
(
full_path
)
return
unless
Ability
.
allowed?
(
current_user
,
:read_package
,
project
)
...
...
app/services/projects/update_remote_mirror_service.rb
View file @
a173249e
...
...
@@ -65,7 +65,7 @@ module Projects
# TODO: Support LFS sync over SSH
# https://gitlab.com/gitlab-org/gitlab/-/issues/249587
return
unless
remote_mirror
.
url
=~
/\Ahttps?:\/\//
i
return
unless
remote_mirror
.
url
=~
%r{
\A
https?://}
i
return
unless
remote_mirror
.
password_auth?
Lfs
::
PushService
.
new
(
...
...
config/initializers/rspec_profiling.rb
View file @
a173249e
...
...
@@ -61,7 +61,7 @@ RspecProfiling.configure do |config|
RspecProfiling
::
Run
.
prepend
(
RspecProfilingExt
::
Run
)
config
.
collector
=
RspecProfilingExt
::
Collectors
::
CSVWithTimestamps
config
.
csv_path
=
->
do
prefix
=
"
#{
ENV
[
'CI_JOB_NAME'
]
}
-"
.
gsub
(
/[ \/]/
,
'-'
)
if
ENV
[
'CI_JOB_NAME'
]
prefix
=
"
#{
ENV
[
'CI_JOB_NAME'
]
}
-"
.
gsub
(
%r{[ /]}
,
'-'
)
if
ENV
[
'CI_JOB_NAME'
]
"rspec_profiling/
#{
prefix
}#{
Time
.
now
.
to_i
}
-
#{
SecureRandom
.
hex
(
8
)
}
-rspec-data.csv"
end
end
...
...
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