mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 02:46:52 +00:00
Git and Mercurial hooks respect FLAKE8_LAZY
This commit is contained in:
parent
016ec97514
commit
b4d786a393
1 changed files with 10 additions and 1 deletions
|
|
@ -178,10 +178,16 @@ from flake8.hooks import git_hook
|
|||
COMPLEXITY = os.getenv('FLAKE8_COMPLEXITY', 10)
|
||||
STRICT = os.getenv('FLAKE8_STRICT', False)
|
||||
IGNORE = os.getenv('FLAKE8_IGNORE')
|
||||
LAZY = os.getenv('FLAKE8_LAZY', False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(git_hook(complexity=COMPLEXITY, strict=STRICT, ignore=IGNORE))
|
||||
sys.exit(git_hook(
|
||||
complexity=COMPLEXITY,
|
||||
strict=STRICT,
|
||||
ignore=IGNORE,
|
||||
lazy=LAZY,
|
||||
))
|
||||
"""
|
||||
|
||||
|
||||
|
|
@ -213,6 +219,9 @@ def _install_hg_hook(path):
|
|||
if not c.has_option('flake8', 'ignore'):
|
||||
c.set('flake8', 'ignore', os.getenv('FLAKE8_IGNORE'))
|
||||
|
||||
if not c.has_option('flake8', 'lazy'):
|
||||
c.set('flake8', 'lazy', os.getenv('FLAKE8_LAZY', False))
|
||||
|
||||
c.write(open(path, 'w+'))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue