Ian Cordasco avatar Ian Cordasco committed aebc676

Seems the git hook now allows items to be ignored.

I am unable to test the mercurial hook however since I seem to have an older
version of mercurial. I'd appreciate feedback.

Comments (0)

Files changed (1)

     global pep8style
     if pep8style is None:
         pep8style = pep8.StyleGuide(config_file=True)
-    pep8.options = _PEP8Options()
-    pep8.options.physical_checks = pep8.find_checks('physical_line')
-    pep8.options.logical_checks = pep8.find_checks('logical_line')
-    pep8.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
-    pep8.options.messages = {}
-    pep8.options.max_line_length = 79
-    pep8.args = []
+    #pep8style.options.physical_checks = pep8.find_checks('physical_line')
+    #pep8style.options.logical_checks = pep8.find_checks('logical_line')
+    pep8style.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
+    pep8style.options.messages = {}
+    pep8style.options.max_line_length = 79
+    pep8style.args = []
 
 
 def run(command):
 def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
     _initpep8()
     if ignore:
-        pep8.options.ignore = ignore
+        pep8style.options.ignore = ignore
 
     warnings = 0
 
             continue
         if not os.path.exists(filename):
             continue
-        warnings += check_file(path=filename, ignore=ignore, complexity=complexity)
+        warnings += check_file(path=filename, ignore=ignore,
+                               complexity=complexity)
 
     if strict:
         return warnings
 
 def hg_hook(ui, repo, **kwargs):
     _initpep8()
-    complexity = ui.configint('flake8', 'complexity', default=-1)
+    complexity = ui.config('flake8', 'complexity', default=-1)
     warnings = 0
 
     for file_ in _get_files(repo, **kwargs):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.