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
2ceed9ac
Commit
2ceed9ac
authored
Sep 02, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lint-uri-regex' into 'master'
Fix Lint/UriRegexp cop See merge request gitlab-org/gitlab!41117
parents
84a0cc43
d6f70305
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
11 deletions
+8
-11
.rubocop_todo.yml
.rubocop_todo.yml
+0
-8
app/models/concerns/mentionable/reference_regexes.rb
app/models/concerns/mentionable/reference_regexes.rb
+1
-1
app/services/projects/download_service.rb
app/services/projects/download_service.rb
+1
-1
changelogs/unreleased/lint-uri-regex.yml
changelogs/unreleased/lint-uri-regex.yml
+5
-0
lib/gitlab/ci/pipeline/chain/config/content/remote.rb
lib/gitlab/ci/pipeline/chain/config/content/remote.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
2ceed9ac
...
...
@@ -113,14 +113,6 @@ Lint/UriEscapeUnescape:
-
'
spec/lib/google_api/auth_spec.rb'
-
'
spec/requests/api/files_spec.rb'
# Offense count: 3
# Cop supports --auto-correct.
Lint/UriRegexp
:
Exclude
:
-
'
app/models/concerns/mentionable/reference_regexes.rb'
-
'
app/services/projects/download_service.rb'
-
'
lib/gitlab/ci/pipeline/chain/config/content/remote.rb'
# Offense count: 65
# Cop supports --auto-correct.
Migration/DepartmentName
:
...
...
app/models/concerns/mentionable/reference_regexes.rb
View file @
2ceed9ac
...
...
@@ -30,7 +30,7 @@ module Mentionable
def
self
.
external_pattern
strong_memoize
(
:external_pattern
)
do
issue_pattern
=
IssueTrackerService
.
reference_pattern
link_patterns
=
URI
.
regexp
(
%w(http https)
)
link_patterns
=
URI
::
DEFAULT_PARSER
.
make_
regexp
(
%w(http https)
)
reference_pattern
(
link_patterns
,
issue_pattern
)
end
end
...
...
app/services/projects/download_service.rb
View file @
2ceed9ac
...
...
@@ -27,7 +27,7 @@ module Projects
end
def
http?
(
url
)
url
=~
/\A
#{
URI
.
regexp
(
%w(http https)
)
}
\z/
url
=~
/\A
#{
URI
::
DEFAULT_PARSER
.
make_
regexp
(
%w(http https)
)
}
\z/
end
def
valid_domain?
(
url
)
...
...
changelogs/unreleased/lint-uri-regex.yml
0 → 100644
View file @
2ceed9ac
---
title
:
Fix Lint/UriRegexp cop
merge_request
:
41117
author
:
Rajendra Kadam
type
:
fixed
lib/gitlab/ci/pipeline/chain/config/content/remote.rb
View file @
2ceed9ac
...
...
@@ -9,7 +9,7 @@ module Gitlab
class
Remote
<
Source
def
content
strong_memoize
(
:content
)
do
next
unless
ci_config_path
=~
URI
.
regexp
(
%w[http https]
)
next
unless
ci_config_path
=~
URI
::
DEFAULT_PARSER
.
make_
regexp
(
%w[http https]
)
YAML
.
dump
(
'include'
=>
[{
'remote'
=>
ci_config_path
}])
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