diff options
| author | Florian Rathgeber <florian.rathgeber@gmail.com> | 2013-10-26 14:06:10 -0500 |
|---|---|---|
| committer | Florian Rathgeber <florian.rathgeber@gmail.com> | 2013-10-26 14:06:10 -0500 |
| commit | b4d786a393acfcc9ae21790d2aa57686ec85e187 (patch) | |
| tree | 34b3fe3f3f34f43d05c351786ee98a491fe793a5 /flake8/hooks.py | |
| parent | 016ec9751463a171fa2e2580b3098a2f1967b677 (diff) | |
| download | flake8-b4d786a393acfcc9ae21790d2aa57686ec85e187.tar.gz | |
Git and Mercurial hooks respect FLAKE8_LAZY
Diffstat (limited to 'flake8/hooks.py')
| -rw-r--r-- | flake8/hooks.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/flake8/hooks.py b/flake8/hooks.py index 9dddecd..5173883 100644 --- a/flake8/hooks.py +++ b/flake8/hooks.py @@ -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+')) |
