mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 06:44:18 +00:00
The hg hook should now have the same output as a direct call to flake8.
This commit is contained in:
parent
ad87ad1960
commit
b4f73f0f8c
1 changed files with 16 additions and 5 deletions
|
|
@ -73,12 +73,22 @@ def _get_files(repo, **kwargs):
|
||||||
|
|
||||||
|
|
||||||
class _PEP8Options(object):
|
class _PEP8Options(object):
|
||||||
exclude = select = []
|
# Default options taken from pep8.process_options()
|
||||||
show_pep8 = show_source = quiet = verbose = testsuite = False
|
max_complexity = -1
|
||||||
|
verbose = False
|
||||||
|
quiet = False
|
||||||
no_repeat = False
|
no_repeat = False
|
||||||
counters = {}
|
exclude = [exc.rstrip('/') for exc in pep8.DEFAULT_EXCLUDE.split(',')]
|
||||||
messages = {}
|
filename = ['*.py']
|
||||||
ignore = pep8.DEFAULT_IGNORE
|
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):
|
def hg_hook(ui, repo, **kwargs):
|
||||||
|
|
@ -87,6 +97,7 @@ def hg_hook(ui, repo, **kwargs):
|
||||||
pep8.options.physical_checks = pep8.find_checks('physical_line')
|
pep8.options.physical_checks = pep8.find_checks('physical_line')
|
||||||
pep8.options.logical_checks = pep8.find_checks('logical_line')
|
pep8.options.logical_checks = pep8.find_checks('logical_line')
|
||||||
pep8.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
|
pep8.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
|
||||||
|
pep8.options.messages = {}
|
||||||
pep8.args = []
|
pep8.args = []
|
||||||
complexity = ui.configint('flake8', 'complexity', default=-1)
|
complexity = ui.configint('flake8', 'complexity', default=-1)
|
||||||
warnings = 0
|
warnings = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue