mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-30 18:26:53 +00:00
Merge pull request #79 from chriskuehl/requirements-sorter-nocase
Sort requirements.txt case-insensitively
This commit is contained in:
commit
616c1ebd18
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