Merge pull request #133 from pre-commit/customizable_encoding_pragma

Allow encoding pragma to be customizable
diff --git a/hooks.yaml b/hooks.yaml
index 08f01c5..0e1259e 100644
--- a/hooks.yaml
+++ b/hooks.yaml
@@ -140,4 +140,4 @@
     description: This hook trims trailing whitespace.
     entry: trailing-whitespace-fixer
     language: python
-    files: \.(c|cpp|html|erb|slim|haml|ejs|jade|js|coffee|json|rb|md|py|css|scss|less|sh|tmpl|txt|yaml|yml|pp)$
+    files: \.(asciidoc|adoc|coffee|cpp|css|c|ejs|erb|h|haml|hh|hpp|hxx|html|in|jade|json|js|less|markdown|md|ml|mli|pp|py|rb|rs|R|scss|sh|slim|tmpl|txt|yaml|yml)$
diff --git a/pre_commit_hooks/debug_statement_hook.py b/pre_commit_hooks/debug_statement_hook.py
index 8e02480..52fe72e 100644
--- a/pre_commit_hooks/debug_statement_hook.py
+++ b/pre_commit_hooks/debug_statement_hook.py
@@ -7,7 +7,7 @@
 import traceback
 
 
-DEBUG_STATEMENTS = set(['pdb', 'ipdb', 'pudb', 'q'])
+DEBUG_STATEMENTS = set(['pdb', 'ipdb', 'pudb', 'q', 'rdb'])
 
 
 DebugStatement = collections.namedtuple(
diff --git a/pre_commit_hooks/requirements_txt_fixer.py b/pre_commit_hooks/requirements_txt_fixer.py
index bf7f75d..64b5e47 100644
--- a/pre_commit_hooks/requirements_txt_fixer.py
+++ b/pre_commit_hooks/requirements_txt_fixer.py
@@ -10,6 +10,13 @@
         self.value = None
         self.comments = []
 
+    @property
+    def name(self):
+        if self.value.startswith(b'-e '):
+            return self.value.lower().partition(b'=')[-1]
+
+        return self.value.lower().partition(b'==')[0]
+
     def __lt__(self, requirement):
         # \n means top of file comment, so always return True,
         # otherwise just do a string comparison with value.
@@ -18,10 +25,7 @@
         elif requirement.value == b'\n':
             return False
         else:
-            return (
-                self.value.lower().partition(b'==') <
-                requirement.value.lower().partition(b'==')
-            )
+            return self.name < requirement.name
 
 
 def fix_requirements(f):
diff --git a/tests/requirements_txt_fixer_test.py b/tests/requirements_txt_fixer_test.py
index fe51f4a..1c590a5 100644
--- a/tests/requirements_txt_fixer_test.py
+++ b/tests/requirements_txt_fixer_test.py
@@ -15,6 +15,7 @@
     (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'),
+    (b'-e git+ssh://git_url@tag#egg=ocflib\nDjango\nPyMySQL\n', 1, b'Django\n-e git+ssh://git_url@tag#egg=ocflib\nPyMySQL\n'),
 )