Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
ExternalRepo
pre-commit-hooks
提交
8a36145f
未验证
提交
8a36145f
编辑于
5年前
作者:
Anthony Sottile
提交者:
GitHub
5年前
浏览文件
操作
下载
差异文件
Merge pull request #425 from vinayinvicible/url-req
Fixed sorting for non editable requirement urls
上级
00e8510d
189e33e4
main
remove-fix-encoding-pragma
v4.6.0
v4.5.0
v4.4.0
v4.3.0
v4.2.0
v4.1.0
v4.0.1
v4.0.0
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.1
v3.0.0
v2.5.0
无相关合并请求
变更
2
Hide whitespace changes
Inline
Side-by-side
显示
2 个更改的文件
pre_commit_hooks/requirements_txt_fixer.py
+3
-2
pre_commit_hooks/requirements_txt_fixer.py
tests/requirements_txt_fixer_test.py
+5
-0
tests/requirements_txt_fixer_test.py
有
8 个添加
和
2 个删除
+8
-2
pre_commit_hooks/requirements_txt_fixer.py
+
3
-
2
浏览文件 @
8a36145f
...
...
@@ -21,8 +21,9 @@ class Requirement(object):
@
property
def
name
(
self
):
# type: () -> bytes
assert
self
.
value
is
not
None
,
self
.
value
if
self
.
value
.
startswith
(
b
'-e '
):
return
self
.
value
.
lower
().
partition
(
b
'='
)[
-
1
]
for
egg
in
(
b
'#egg='
,
b
'&egg='
):
if
egg
in
self
.
value
:
return
self
.
value
.
lower
().
partition
(
egg
)[
-
1
]
return
self
.
value
.
lower
().
partition
(
b
'=='
)[
0
]
...
...
This diff is collapsed.
Click to expand it.
tests/requirements_txt_fixer_test.py
+
5
-
0
浏览文件 @
8a36145f
...
...
@@ -45,6 +45,11 @@ from pre_commit_hooks.requirements_txt_fixer import Requirement
),
(
b
'bar
\n
pkg-resources==0.0.0
\n
foo
\n
'
,
FAIL
,
b
'bar
\n
foo
\n
'
),
(
b
'foo
\n
pkg-resources==0.0.0
\n
bar
\n
'
,
FAIL
,
b
'bar
\n
foo
\n
'
),
(
b
'git+ssh://git_url@tag#egg=ocflib
\n
Django
\n
ijk
\n
'
,
FAIL
,
b
'Django
\n
ijk
\n
git+ssh://git_url@tag#egg=ocflib
\n
'
,
),
),
)
def
test_integration
(
input_s
,
expected_retval
,
output
,
tmpdir
):
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段