Commit 2511c19f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'dm-requirements-txt-tilde' into 'master'

Don't match tilde and exclamation mark as part of requirements.txt package name

Closes #34166

See merge request !12431
parents c00f81d8 11e22835
---
title: Don't match tilde and exclamation mark as part of requirements.txt package
name
merge_request:
author:
......@@ -6,7 +6,7 @@ module Gitlab
private
def link_dependencies
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=;\[]+)/) do |name|
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=~!;\[]+)/) do |name|
"https://pypi.python.org/pypi/#{name}"
end
......
......@@ -54,6 +54,8 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
Sphinx>=1.3
docutils>=0.7
markupsafe
pytest~=3.0
foop!=3.0
CONTENT
end
......@@ -78,6 +80,8 @@ describe Gitlab::DependencyLinker::RequirementsTxtLinker, lib: true do
expect(subject).to include(link('Sphinx', 'https://pypi.python.org/pypi/Sphinx'))
expect(subject).to include(link('docutils', 'https://pypi.python.org/pypi/docutils'))
expect(subject).to include(link('markupsafe', 'https://pypi.python.org/pypi/markupsafe'))
expect(subject).to include(link('pytest', 'https://pypi.python.org/pypi/pytest'))
expect(subject).to include(link('foop', 'https://pypi.python.org/pypi/foop'))
end
it 'links URLs' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment