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
eab8766b
Commit
eab8766b
authored
Sep 03, 2020
by
Rajendra Kadam
Committed by
Rémy Coutable
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/PerlBackrefs cop
This fixes the Style/PerlBackrefs cop
parent
146c43c9
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
18 additions
and
29 deletions
+18
-29
.rubocop_todo.yml
.rubocop_todo.yml
+0
-16
app/controllers/projects/application_controller.rb
app/controllers/projects/application_controller.rb
+2
-2
app/helpers/submodule_helper.rb
app/helpers/submodule_helper.rb
+1
-1
changelogs/unreleased/perl-backref-cop.yml
changelogs/unreleased/perl-backref-cop.yml
+5
-0
lib/backup/manager.rb
lib/backup/manager.rb
+1
-1
lib/banzai/filter/abstract_reference_filter.rb
lib/banzai/filter/abstract_reference_filter.rb
+2
-2
lib/banzai/filter/autolink_filter.rb
lib/banzai/filter/autolink_filter.rb
+1
-1
lib/banzai/filter/emoji_filter.rb
lib/banzai/filter/emoji_filter.rb
+1
-1
lib/banzai/filter/gollum_tags_filter.rb
lib/banzai/filter/gollum_tags_filter.rb
+1
-1
lib/expand_variables.rb
lib/expand_variables.rb
+1
-1
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+1
-1
lib/gitlab/search_results.rb
lib/gitlab/search_results.rb
+1
-1
lib/gitlab/sherlock/query.rb
lib/gitlab/sherlock/query.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
eab8766b
...
...
@@ -638,22 +638,6 @@ Style/ParallelAssignment:
Style/PercentLiteralDelimiters
:
Enabled
:
false
# Offense count: 15
# Cop supports --auto-correct.
Style/PerlBackrefs
:
Exclude
:
-
'
app/controllers/projects/application_controller.rb'
-
'
app/helpers/submodule_helper.rb'
-
'
lib/backup/manager.rb'
-
'
lib/banzai/filter/abstract_reference_filter.rb'
-
'
lib/banzai/filter/autolink_filter.rb'
-
'
lib/banzai/filter/emoji_filter.rb'
-
'
lib/banzai/filter/gollum_tags_filter.rb'
-
'
lib/expand_variables.rb'
-
'
lib/gitlab/diff/highlight.rb'
-
'
lib/gitlab/search_results.rb'
-
'
lib/gitlab/sherlock/query.rb'
# Offense count: 200
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
...
...
app/controllers/projects/application_controller.rb
View file @
eab8766b
...
...
@@ -58,9 +58,9 @@ class Projects::ApplicationController < ApplicationController
def
method_missing
(
method_sym
,
*
arguments
,
&
block
)
case
method_sym
.
to_s
when
/\Aauthorize_(.*)!\z/
authorize_action!
(
$1
.
to_sym
)
authorize_action!
(
Regexp
.
last_match
(
1
)
.
to_sym
)
when
/\Acheck_(.*)_available!\z/
check_project_feature_available!
(
$1
.
to_sym
)
check_project_feature_available!
(
Regexp
.
last_match
(
1
)
.
to_sym
)
else
super
end
...
...
app/helpers/submodule_helper.rb
View file @
eab8766b
...
...
@@ -18,7 +18,7 @@ module SubmoduleHelper
end
if
url
=~
%r{([^/:]+)/([^/]+(?:
\.
git)?)
\Z
}
namespace
,
project
=
$1
,
$2
namespace
,
project
=
Regexp
.
last_match
(
1
),
Regexp
.
last_match
(
2
)
gitlab_hosts
=
[
Gitlab
.
config
.
gitlab
.
url
,
Gitlab
.
config
.
gitlab_shell
.
ssh_path_prefix
]
...
...
changelogs/unreleased/perl-backref-cop.yml
0 → 100644
View file @
eab8766b
---
title
:
Fix Style/PerlBackrefs cop
merge_request
:
41246
author
:
Rajendra Kadam
type
:
fixed
lib/backup/manager.rb
View file @
eab8766b
...
...
@@ -88,7 +88,7 @@ module Backup
# - 1495527097_2017_05_23_9.3.0-pre_gitlab_backup.tar
next
unless
file
=~
/^(\d{10})(?:_\d{4}_\d{2}_\d{2}(_\d+\.\d+\.\d+((-|\.)(pre|rc\d))?(-ee)?)?)?_gitlab_backup\.tar$/
timestamp
=
$1
.
to_i
timestamp
=
Regexp
.
last_match
(
1
)
.
to_i
if
Time
.
at
(
timestamp
)
<
(
Time
.
now
-
keep_time
)
begin
...
...
lib/banzai/filter/abstract_reference_filter.rb
View file @
eab8766b
...
...
@@ -265,7 +265,7 @@ module Banzai
extras
=
[]
if
matches
.
names
.
include?
(
"anchor"
)
&&
matches
[
:anchor
]
&&
matches
[
:anchor
]
=~
/\A\#note_(\d+)\z/
extras
<<
"comment
#{
$1
}
"
extras
<<
"comment
#{
Regexp
.
last_match
(
1
)
}
"
end
extension
=
matches
[
:extension
]
if
matches
.
names
.
include?
(
"extension"
)
...
...
@@ -436,7 +436,7 @@ module Banzai
escaped
=
escape_html_entities
(
text
)
escaped
.
gsub
(
REFERENCE_PLACEHOLDER_PATTERN
)
do
|
match
|
placeholder_data
[
$1
.
to_i
]
placeholder_data
[
Regexp
.
last_match
(
1
)
.
to_i
]
end
end
end
...
...
lib/banzai/filter/autolink_filter.rb
View file @
eab8766b
...
...
@@ -86,7 +86,7 @@ module Banzai
# outside the link element. The entity must be marked HTML safe in
# order to be output literally rather than escaped.
match
.
gsub!
(
/((?:&[\w#]+;)+)\z/
,
''
)
dropped
=
(
$1
||
''
).
html_safe
dropped
=
(
Regexp
.
last_match
(
1
)
||
''
).
html_safe
# To match the behaviour of Rinku, if the matched link ends with a
# closing part of a matched pair of punctuation, we remove that trailing
...
...
lib/banzai/filter/emoji_filter.rb
View file @
eab8766b
...
...
@@ -33,7 +33,7 @@ module Banzai
# Returns a String with :emoji: replaced with gl-emoji unicode.
def
emoji_name_element_unicode_filter
(
text
)
text
.
gsub
(
emoji_pattern
)
do
|
match
|
name
=
$1
name
=
Regexp
.
last_match
(
1
)
Gitlab
::
Emoji
.
gl_emoji_tag
(
name
)
end
end
...
...
lib/banzai/filter/gollum_tags_filter.rb
View file @
eab8766b
...
...
@@ -64,7 +64,7 @@ module Banzai
next
if
has_ancestor?
(
node
,
IGNORED_ANCESTOR_TAGS
)
next
unless
node
.
content
=~
TAGS_PATTERN
html
=
process_tag
(
$1
)
html
=
process_tag
(
Regexp
.
last_match
(
1
)
)
node
.
replace
(
html
)
if
html
&&
html
!=
node
.
content
end
...
...
lib/expand_variables.rb
View file @
eab8766b
...
...
@@ -7,7 +7,7 @@ module ExpandVariables
value
.
gsub
(
/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}|%\g<1>%/
)
do
variables_hash
||=
transform_variables
(
variables
)
variables_hash
[
$1
||
$2
]
variables_hash
[
Regexp
.
last_match
(
1
)
||
Regexp
.
last_match
(
2
)
]
end
end
...
...
lib/gitlab/diff/highlight.rb
View file @
eab8766b
...
...
@@ -60,7 +60,7 @@ module Gitlab
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.
if
rich_line
line_prefix
=
diff_line
.
text
=~
/\A(.)/
?
$1
:
' '
line_prefix
=
diff_line
.
text
=~
/\A(.)/
?
Regexp
.
last_match
(
1
)
:
' '
"
#{
line_prefix
}#{
rich_line
}
"
.
html_safe
end
end
...
...
lib/gitlab/search_results.rb
View file @
eab8766b
...
...
@@ -186,7 +186,7 @@ module Gitlab
params
[
:sort
]
=
'updated_desc'
if
query
=~
/#(\d+)\z/
params
[
:iids
]
=
$1
params
[
:iids
]
=
Regexp
.
last_match
(
1
)
else
params
[
:search
]
=
query
end
...
...
lib/gitlab/sherlock/query.rb
View file @
eab8766b
...
...
@@ -105,7 +105,7 @@ module Gitlab
query
.
each_line
.
map
{
|
line
|
line
.
strip
}
.
join
(
"
\n
"
)
.
gsub
(
PREFIX_NEWLINE
)
{
"
\n
#{
$1
}
"
}
.
gsub
(
PREFIX_NEWLINE
)
{
"
\n
#{
Regexp
.
last_match
(
1
)
}
"
}
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