mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-03 02:56:52 +00:00
Sort requirements.txt case-insensitively
This commit is contained in:
parent
c2992bd3a1
commit
a1b0104f3d
2 changed files with 3 additions and 2 deletions
|
|
@ -19,8 +19,8 @@ class Requirement(object):
|
|||
return False
|
||||
else:
|
||||
return (
|
||||
self.value.partition(b'==') <
|
||||
requirement.value.partition(b'==')
|
||||
self.value.lower().partition(b'==') <
|
||||
requirement.value.lower().partition(b'==')
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ TESTS = (
|
|||
(b'\nfoo\nbar\n', 1, b'bar\n\nfoo\n'),
|
||||
(b'\nbar\nfoo\n', 0, b'\nbar\nfoo\n'),
|
||||
(b'pyramid==1\npyramid-foo==2\n', 0, b'pyramid==1\npyramid-foo==2\n'),
|
||||
(b'ocflib\nDjango\nPyMySQL\n', 1, b'Django\nocflib\nPyMySQL\n'),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue