{"action":"created","comment":{"url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/comments/37272340","id":37272340,"diff_hunk":"@@ -19,8 +19,8 @@ def __lt__(self, requirement):\n             return False\n         else:\n             return (\n-                self.value.partition(b'==') <\n-                requirement.value.partition(b'==')\n+                self.value.lower().partition(b'==') <","path":"pre_commit_hooks/requirements_txt_fixer.py","position":6,"original_position":6,"commit_id":"a1b0104f3d81b8323c9968649501d662301e04b8","original_commit_id":"a1b0104f3d81b8323c9968649501d662301e04b8","user":{"login":"arahayrabedian","id":5959895,"avatar_url":"https://avatars.githubusercontent.com/u/5959895?v=3","gravatar_id":"","url":"https://api.github.com/users/arahayrabedian","html_url":"https://github.com/arahayrabedian","followers_url":"https://api.github.com/users/arahayrabedian/followers","following_url":"https://api.github.com/users/arahayrabedian/following{/other_user}","gists_url":"https://api.github.com/users/arahayrabedian/gists{/gist_id}","starred_url":"https://api.github.com/users/arahayrabedian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arahayrabedian/subscriptions","organizations_url":"https://api.github.com/users/arahayrabedian/orgs","repos_url":"https://api.github.com/users/arahayrabedian/repos","events_url":"https://api.github.com/users/arahayrabedian/events{/privacy}","received_events_url":"https://api.github.com/users/arahayrabedian/received_events","type":"User","site_admin":false},"body":"it's possible to have >=, <=, etc in a requirements file, no?","created_at":"2015-08-18T07:48:56Z","updated_at":"2015-08-18T07:48:56Z","html_url":"https://github.com/pre-commit/pre-commit-hooks/pull/79#discussion_r37272340","pull_request_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/comments/37272340"},"html":{"href":"https://github.com/pre-commit/pre-commit-hooks/pull/79#discussion_r37272340"},"pull_request":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79","id":42626963,"html_url":"https://github.com/pre-commit/pre-commit-hooks/pull/79","diff_url":"https://github.com/pre-commit/pre-commit-hooks/pull/79.diff","patch_url":"https://github.com/pre-commit/pre-commit-hooks/pull/79.patch","issue_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/79","number":79,"state":"closed","locked":false,"title":"Sort requirements.txt case-insensitively","user":{"login":"chriskuehl","id":665269,"avatar_url":"https://avatars.githubusercontent.com/u/665269?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskuehl","html_url":"https://github.com/chriskuehl","followers_url":"https://api.github.com/users/chriskuehl/followers","following_url":"https://api.github.com/users/chriskuehl/following{/other_user}","gists_url":"https://api.github.com/users/chriskuehl/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskuehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskuehl/subscriptions","organizations_url":"https://api.github.com/users/chriskuehl/orgs","repos_url":"https://api.github.com/users/chriskuehl/repos","events_url":"https://api.github.com/users/chriskuehl/events{/privacy}","received_events_url":"https://api.github.com/users/chriskuehl/received_events","type":"User","site_admin":false},"body":"Every time I `pip freeze` to update my requirements.txt and then run pre-commit, I get diffs like:\r\n```diff\r\n--- a/requirements.txt\r\n+++ b/requirements.txt\r\n@@ -1,6 +1,8 @@\r\n+Django==1.8.3\r\n+PyMySQL==0.6.6\r\n+SQLAlchemy==1.0.8\r\n colorama==0.3.3\r\n cracklib==2.9.3\r\n-Django==1.8.3\r\n dnspython3==1.12.0\r\n ecdsa==0.13\r\n gunicorn==19.3.0\r\n@@ -10,7 +12,5 @@ paramiko==1.15.2\r\n pexpect==3.2\r\n pyasn1==0.1.8\r\n pycrypto==2.6.1\r\n-PyMySQL==0.6.6\r\n pysnmp==4.2.5\r\n requests==2.7.0\r\n-SQLAlchemy==1.0.8\r\n```\r\n\r\nIMO the pip behavior is more useful (putting capitalized deps at the top seems unhelpful, especially since they can appear lowercase or uppercase and still be correct). Plus this avoids unnecessary churn.\r\n\r\nFWIW I think this is a behavior of newer versions of pip; old pip (1.5.6) seems to keep capitals at the top, while the latest doesn't.","created_at":"2015-08-17T19:52:56Z","updated_at":"2015-08-18T07:48:56Z","closed_at":"2015-08-17T19:55:56Z","merged_at":"2015-08-17T19:55:56Z","merge_commit_sha":"6600636842d1c18bb9e4d993dfdba6da7331e4d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79/commits","review_comments_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79/comments","review_comment_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/79/comments","statuses_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/statuses/a1b0104f3d81b8323c9968649501d662301e04b8","head":{"label":"chriskuehl:requirements-sorter-nocase","ref":"requirements-sorter-nocase","sha":"a1b0104f3d81b8323c9968649501d662301e04b8","user":{"login":"chriskuehl","id":665269,"avatar_url":"https://avatars.githubusercontent.com/u/665269?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskuehl","html_url":"https://github.com/chriskuehl","followers_url":"https://api.github.com/users/chriskuehl/followers","following_url":"https://api.github.com/users/chriskuehl/following{/other_user}","gists_url":"https://api.github.com/users/chriskuehl/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskuehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskuehl/subscriptions","organizations_url":"https://api.github.com/users/chriskuehl/orgs","repos_url":"https://api.github.com/users/chriskuehl/repos","events_url":"https://api.github.com/users/chriskuehl/events{/privacy}","received_events_url":"https://api.github.com/users/chriskuehl/received_events","type":"User","site_admin":false},"repo":{"id":39812855,"name":"pre-commit-hooks","full_name":"chriskuehl/pre-commit-hooks","owner":{"login":"chriskuehl","id":665269,"avatar_url":"https://avatars.githubusercontent.com/u/665269?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskuehl","html_url":"https://github.com/chriskuehl","followers_url":"https://api.github.com/users/chriskuehl/followers","following_url":"https://api.github.com/users/chriskuehl/following{/other_user}","gists_url":"https://api.github.com/users/chriskuehl/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskuehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskuehl/subscriptions","organizations_url":"https://api.github.com/users/chriskuehl/orgs","repos_url":"https://api.github.com/users/chriskuehl/repos","events_url":"https://api.github.com/users/chriskuehl/events{/privacy}","received_events_url":"https://api.github.com/users/chriskuehl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chriskuehl/pre-commit-hooks","description":"Some out-of-the-box hooks for pre-commit","fork":true,"url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks","forks_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/forks","keys_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/teams","hooks_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/hooks","issue_events_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/issues/events{/number}","events_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/events","assignees_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/assignees{/user}","branches_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/branches{/branch}","tags_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/tags","blobs_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/statuses/{sha}","languages_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/languages","stargazers_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/stargazers","contributors_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/contributors","subscribers_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/subscribers","subscription_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/subscription","commits_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/contents/{+path}","compare_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/merges","archive_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/downloads","issues_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/issues{/number}","pulls_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/pulls{/number}","milestones_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/milestones{/number}","notifications_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/labels{/name}","releases_url":"https://api.github.com/repos/chriskuehl/pre-commit-hooks/releases{/id}","created_at":"2015-07-28T04:22:02Z","updated_at":"2015-07-28T04:22:02Z","pushed_at":"2015-08-17T19:44:43Z","git_url":"git://github.com/chriskuehl/pre-commit-hooks.git","ssh_url":"git@github.com:chriskuehl/pre-commit-hooks.git","clone_url":"https://github.com/chriskuehl/pre-commit-hooks.git","svn_url":"https://github.com/chriskuehl/pre-commit-hooks","homepage":null,"size":209,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"private-key-print-only-filename"}},"base":{"label":"pre-commit:master","ref":"master","sha":"c2992bd3a11e3c0c2533ee370c26ac2b12d3a1b3","user":{"login":"pre-commit","id":6943086,"avatar_url":"https://avatars.githubusercontent.com/u/6943086?v=3","gravatar_id":"","url":"https://api.github.com/users/pre-commit","html_url":"https://github.com/pre-commit","followers_url":"https://api.github.com/users/pre-commit/followers","following_url":"https://api.github.com/users/pre-commit/following{/other_user}","gists_url":"https://api.github.com/users/pre-commit/gists{/gist_id}","starred_url":"https://api.github.com/users/pre-commit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pre-commit/subscriptions","organizations_url":"https://api.github.com/users/pre-commit/orgs","repos_url":"https://api.github.com/users/pre-commit/repos","events_url":"https://api.github.com/users/pre-commit/events{/privacy}","received_events_url":"https://api.github.com/users/pre-commit/received_events","type":"Organization","site_admin":false},"repo":{"id":17714713,"name":"pre-commit-hooks","full_name":"pre-commit/pre-commit-hooks","owner":{"login":"pre-commit","id":6943086,"avatar_url":"https://avatars.githubusercontent.com/u/6943086?v=3","gravatar_id":"","url":"https://api.github.com/users/pre-commit","html_url":"https://github.com/pre-commit","followers_url":"https://api.github.com/users/pre-commit/followers","following_url":"https://api.github.com/users/pre-commit/following{/other_user}","gists_url":"https://api.github.com/users/pre-commit/gists{/gist_id}","starred_url":"https://api.github.com/users/pre-commit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pre-commit/subscriptions","organizations_url":"https://api.github.com/users/pre-commit/orgs","repos_url":"https://api.github.com/users/pre-commit/repos","events_url":"https://api.github.com/users/pre-commit/events{/privacy}","received_events_url":"https://api.github.com/users/pre-commit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pre-commit/pre-commit-hooks","description":"Some out-of-the-box hooks for pre-commit","fork":false,"url":"https://api.github.com/repos/pre-commit/pre-commit-hooks","forks_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/forks","keys_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/teams","hooks_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/hooks","issue_events_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/events{/number}","events_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/events","assignees_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/assignees{/user}","branches_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/branches{/branch}","tags_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/tags","blobs_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/git/refs{/sha}","trees_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/statuses/{sha}","languages_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/languages","stargazers_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/stargazers","contributors_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/contributors","subscribers_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/subscribers","subscription_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/subscription","commits_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/commits{/sha}","git_commits_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/git/commits{/sha}","comments_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/comments{/number}","issue_comment_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/comments{/number}","contents_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/contents/{+path}","compare_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/merges","archive_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/downloads","issues_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues{/number}","pulls_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls{/number}","milestones_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/milestones{/number}","notifications_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/labels{/name}","releases_url":"https://api.github.com/repos/pre-commit/pre-commit-hooks/releases{/id}","created_at":"2014-03-13T15:21:46Z","updated_at":"2015-08-17T21:32:54Z","pushed_at":"2015-08-17T19:55:56Z","git_url":"git://github.com/pre-commit/pre-commit-hooks.git","ssh_url":"git@github.com:pre-commit/pre-commit-hooks.git","clone_url":"https://github.com/pre-commit/pre-commit-hooks.git","svn_url":"https://github.com/pre-commit/pre-commit-hooks","homepage":null,"size":851,"stargazers_count":49,"watchers_count":49,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":15,"forks":26,"open_issues":15,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79"},"html":{"href":"https://github.com/pre-commit/pre-commit-hooks/pull/79"},"issue":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/79"},"comments":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/pre-commit/pre-commit-hooks/statuses/a1b0104f3d81b8323c9968649501d662301e04b8"}}}}