Stefan Scherfke avatar Stefan Scherfke committed 3999c2e

The hg hook should now have the same output as a direct call to flake8.

Comments (0)

Files changed (1)

 
 
 class _PEP8Options(object):
-    exclude = select = []
-    show_pep8 = show_source = quiet = verbose = testsuite = False
+    # Default options taken from pep8.process_options()
+    max_complexity = -1
+    verbose = False
+    quiet = False
     no_repeat = False
-    counters = {}
-    messages = {}
-    ignore = pep8.DEFAULT_IGNORE
+    exclude = [exc.rstrip('/') for exc in pep8.DEFAULT_EXCLUDE.split(',')]
+    filename = ['*.py']
+    select = []
+    ignore = pep8.DEFAULT_IGNORE.split(',')  # or []?
+    show_source = False
+    show_pep8 = False
+    statistics = False
+    count = False
+    benchmark = False
+    testsuite = ''
+    doctest = False
 
 
 def hg_hook(ui, repo, **kwargs):
     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.args = []
     complexity = ui.configint('flake8', 'complexity', default=-1)
     warnings = 0
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.