mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 04:56:54 +00:00
Merged in huhao/flake8 (pull request #25)
This commit is contained in:
commit
0d29a4b02a
3 changed files with 17 additions and 10 deletions
|
|
@ -123,6 +123,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 = []
|
||||
|
||||
|
||||
|
|
@ -133,8 +134,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