mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 15:24:18 +00:00
Git and Mercurial hooks respect FLAKE8_IGNORE
This commit is contained in:
parent
ac55c9d419
commit
016ec97514
1 changed files with 5 additions and 1 deletions
|
|
@ -177,10 +177,11 @@ from flake8.hooks import git_hook
|
||||||
|
|
||||||
COMPLEXITY = os.getenv('FLAKE8_COMPLEXITY', 10)
|
COMPLEXITY = os.getenv('FLAKE8_COMPLEXITY', 10)
|
||||||
STRICT = os.getenv('FLAKE8_STRICT', False)
|
STRICT = os.getenv('FLAKE8_STRICT', False)
|
||||||
|
IGNORE = os.getenv('FLAKE8_IGNORE')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(git_hook(complexity=COMPLEXITY, strict=STRICT))
|
sys.exit(git_hook(complexity=COMPLEXITY, strict=STRICT, ignore=IGNORE))
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -209,6 +210,9 @@ def _install_hg_hook(path):
|
||||||
if not c.has_option('flake8', 'strict'):
|
if not c.has_option('flake8', 'strict'):
|
||||||
c.set('flake8', 'strict', os.getenv('FLAKE8_STRICT', False))
|
c.set('flake8', 'strict', os.getenv('FLAKE8_STRICT', False))
|
||||||
|
|
||||||
|
if not c.has_option('flake8', 'ignore'):
|
||||||
|
c.set('flake8', 'ignore', os.getenv('FLAKE8_IGNORE'))
|
||||||
|
|
||||||
c.write(open(path, 'w+'))
|
c.write(open(path, 'w+'))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue