Merged in huhao/flake8 (pull request #25)

This commit is contained in:
Tarek Ziadé 2012-09-12 10:03:51 +02:00
commit 0d29a4b02a
3 changed files with 17 additions and 10 deletions

View file

@ -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")