mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
1. mccabe.py support # NOQA 2. run.py support ignore some errors 3. run.py add max_line_length default value
This commit is contained in:
parent
dd92d52f06
commit
ccc7acc62e
3 changed files with 17 additions and 10 deletions
|
|
@ -119,6 +119,7 @@ def _initpep8():
|
|||
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 = []
|
||||
|
||||
|
||||
|
|
@ -129,8 +130,11 @@ def run(command):
|
|||
[line.strip() for line in p.stderr.readlines()])
|
||||
|
||||
|
||||
def git_hook(complexity=-1, strict=False):
|
||||
def git_hook(complexity=-1, strict=False, ignore=None):
|
||||
_initpep8()
|
||||
if ignore:
|
||||
pep8.options.ignore=ignore
|
||||
|
||||
warnings = 0
|
||||
|
||||
_, files_modified, _ = run("git diff-index --cached --name-only HEAD")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue