mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 03:26:53 +00:00
Parse more operators in requirements
This commit is contained in:
parent
3d379a962d
commit
7ebd420417
2 changed files with 37 additions and 5 deletions
|
|
@ -33,9 +33,28 @@ from pre_commit_hooks.requirements_txt_fixer import Requirement
|
|||
(b'\nfoo\nbar\n', FAIL, b'bar\n\nfoo\n'),
|
||||
(b'\nbar\nfoo\n', PASS, b'\nbar\nfoo\n'),
|
||||
(
|
||||
b'pyramid==1\npyramid-foo==2\n',
|
||||
PASS,
|
||||
b'pyramid==1\npyramid-foo==2\n',
|
||||
b'pyramid-foo==1\npyramid>=2\n',
|
||||
FAIL,
|
||||
b'pyramid>=2\npyramid-foo==1\n',
|
||||
),
|
||||
(
|
||||
b'a==1\n'
|
||||
b'c>=1\n'
|
||||
b'bbbb!=1\n'
|
||||
b'c-a>=1;python_version>="3.6"\n'
|
||||
b'e>=2\n'
|
||||
b'd>2\n'
|
||||
b'g<2\n'
|
||||
b'f<=2\n',
|
||||
FAIL,
|
||||
b'a==1\n'
|
||||
b'bbbb!=1\n'
|
||||
b'c>=1\n'
|
||||
b'c-a>=1;python_version>="3.6"\n'
|
||||
b'd>2\n'
|
||||
b'e>=2\n'
|
||||
b'f<=2\n'
|
||||
b'g<2\n',
|
||||
),
|
||||
(b'ocflib\nDjango\nPyMySQL\n', FAIL, b'Django\nocflib\nPyMySQL\n'),
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue