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
db7533b1
Commit
db7533b1
authored
Apr 26, 2021
by
Shubham Kumar
Committed by
Vitali Tatarintev
Apr 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve RuboCop offenses for Style/RedundantRegexpCharacterClass [RUN AS-IF-FOSS]
parent
2b299cf2
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
13 additions
and
22 deletions
+13
-22
.rubocop_todo.yml
.rubocop_todo.yml
+0
-14
app/models/concerns/taskable.rb
app/models/concerns/taskable.rb
+1
-1
changelogs/unreleased/pl-rubocop-todo-redundant-regexp-character-class.yml
...ased/pl-rubocop-todo-redundant-regexp-character-class.yml
+5
-0
ee/app/models/saml_provider.rb
ee/app/models/saml_provider.rb
+1
-1
lib/banzai/filter/markdown_pre_escape_filter.rb
lib/banzai/filter/markdown_pre_escape_filter.rb
+1
-1
lib/gitlab/authorized_keys.rb
lib/gitlab/authorized_keys.rb
+1
-1
lib/gitlab/fogbugz_import/repository.rb
lib/gitlab/fogbugz_import/repository.rb
+1
-1
lib/gitlab/quick_actions/substitution_definition.rb
lib/gitlab/quick_actions/substitution_definition.rb
+1
-1
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+1
-1
spec/features/merge_request/user_views_open_merge_request_spec.rb
...tures/merge_request/user_views_open_merge_request_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
db7533b1
...
@@ -859,20 +859,6 @@ Style/RedundantFetchBlock:
...
@@ -859,20 +859,6 @@ Style/RedundantFetchBlock:
Style/RedundantInterpolation
:
Style/RedundantInterpolation
:
Enabled
:
false
Enabled
:
false
# Offense count: 10
# Cop supports --auto-correct.
Style/RedundantRegexpCharacterClass
:
Exclude
:
-
'
app/models/concerns/taskable.rb'
-
'
ee/app/models/saml_provider.rb'
-
'
lib/banzai/filter/markdown_pre_escape_filter.rb'
-
'
lib/gitlab/authorized_keys.rb'
-
'
lib/gitlab/fogbugz_import/repository.rb'
-
'
lib/gitlab/quick_actions/substitution_definition.rb'
-
'
lib/gitlab/regex.rb'
-
'
spec/features/merge_request/user_views_open_merge_request_spec.rb'
-
'
spec/tasks/gitlab/usage_data_rake_spec.rb'
# Offense count: 279
# Offense count: 279
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/RedundantRegexpEscape
:
Style/RedundantRegexpEscape
:
...
...
app/models/concerns/taskable.rb
View file @
db7533b1
...
@@ -12,7 +12,7 @@ module Taskable
...
@@ -12,7 +12,7 @@ module Taskable
COMPLETED
=
'completed'
COMPLETED
=
'completed'
INCOMPLETE
=
'incomplete'
INCOMPLETE
=
'incomplete'
COMPLETE_PATTERN
=
/(\[[xX]\])/
.
freeze
COMPLETE_PATTERN
=
/(\[[xX]\])/
.
freeze
INCOMPLETE_PATTERN
=
/(\[
[\s]
\])/
.
freeze
INCOMPLETE_PATTERN
=
/(\[
\s
\])/
.
freeze
ITEM_PATTERN
=
%r{
ITEM_PATTERN
=
%r{
^
^
(?:(?:>
\s
{0,4})*) # optional blockquote characters
(?:(?:>
\s
{0,4})*) # optional blockquote characters
...
...
changelogs/unreleased/pl-rubocop-todo-redundant-regexp-character-class.yml
0 → 100644
View file @
db7533b1
---
title
:
Resolve RuboCop offenses for Style/RedundantRegexpCharacterClass
merge_request
:
57914
author
:
Shubham Kumar @imskr
type
:
fixed
ee/app/models/saml_provider.rb
View file @
db7533b1
...
@@ -109,6 +109,6 @@ class SamlProvider < ApplicationRecord
...
@@ -109,6 +109,6 @@ class SamlProvider < ApplicationRecord
end
end
def
strip_left_to_right_chars
(
input
)
def
strip_left_to_right_chars
(
input
)
input
&
.
gsub
(
/
[\u200E]
/
,
''
)
input
&
.
gsub
(
/
\u200E
/
,
''
)
end
end
end
end
lib/banzai/filter/markdown_pre_escape_filter.rb
View file @
db7533b1
...
@@ -26,7 +26,7 @@ module Banzai
...
@@ -26,7 +26,7 @@ module Banzai
class
MarkdownPreEscapeFilter
<
HTML
::
Pipeline
::
TextFilter
class
MarkdownPreEscapeFilter
<
HTML
::
Pipeline
::
TextFilter
# We just need to target those that are special GitLab references
# We just need to target those that are special GitLab references
REFERENCE_CHARACTERS
=
'@#!$&~%^'
REFERENCE_CHARACTERS
=
'@#!$&~%^'
ASCII_PUNCTUATION
=
%r{(
[
\\
]
[
#{
REFERENCE_CHARACTERS
}
])}
.
freeze
ASCII_PUNCTUATION
=
%r{(
\\
[
#{
REFERENCE_CHARACTERS
}
])}
.
freeze
LITERAL_KEYWORD
=
'cmliteral'
LITERAL_KEYWORD
=
'cmliteral'
def
call
def
call
...
...
lib/gitlab/authorized_keys.rb
View file @
db7533b1
...
@@ -161,7 +161,7 @@ module Gitlab
...
@@ -161,7 +161,7 @@ module Gitlab
end
end
def
strip
(
key
)
def
strip
(
key
)
key
.
split
(
/
[ ]
+/
)[
0
,
2
].
join
(
' '
)
key
.
split
(
/
+/
)[
0
,
2
].
join
(
' '
)
end
end
end
end
end
end
lib/gitlab/fogbugz_import/repository.rb
View file @
db7533b1
...
@@ -26,7 +26,7 @@ module Gitlab
...
@@ -26,7 +26,7 @@ module Gitlab
end
end
def
path
def
path
safe_name
.
gsub
(
/
[\s]
/
,
'_'
)
safe_name
.
gsub
(
/
\s
/
,
'_'
)
end
end
end
end
end
end
...
...
lib/gitlab/quick_actions/substitution_definition.rb
View file @
db7533b1
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
return
unless
content
return
unless
content
all_names
.
each
do
|
a_name
|
all_names
.
each
do
|
a_name
|
content
=
content
.
sub
(
%r{/
#{
a_name
}
(?!
[
\S
]
) ?(.*)$}i
,
execute_block
(
action_block
,
context
,
'\1'
))
content
=
content
.
sub
(
%r{/
#{
a_name
}
(?!
\S
) ?(.*)$}i
,
execute_block
(
action_block
,
context
,
'\1'
))
end
end
content
content
...
...
lib/gitlab/regex.rb
View file @
db7533b1
...
@@ -237,7 +237,7 @@ module Gitlab
...
@@ -237,7 +237,7 @@ module Gitlab
# used as a routing constraint.
# used as a routing constraint.
#
#
def
container_registry_tag_regex
def
container_registry_tag_regex
@container_registry_tag_regex
||=
/
[\w]
[\w.-]{0,127}/
@container_registry_tag_regex
||=
/
\w
[\w.-]{0,127}/
end
end
def
environment_name_regex_chars
def
environment_name_regex_chars
...
...
spec/features/merge_request/user_views_open_merge_request_spec.rb
View file @
db7533b1
...
@@ -76,7 +76,7 @@ RSpec.describe 'User views an open merge request' do
...
@@ -76,7 +76,7 @@ RSpec.describe 'User views an open merge request' do
it
'does not show diverged commits count'
do
it
'does not show diverged commits count'
do
page
.
within
(
'.mr-source-target'
)
do
page
.
within
(
'.mr-source-target'
)
do
expect
(
page
).
not_to
have_content
(
/([0-9]+ commit
[s]
? behind)/
)
expect
(
page
).
not_to
have_content
(
/([0-9]+ commit
s
? behind)/
)
end
end
end
end
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