summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Rathgeber <florian.rathgeber@gmail.com>2013-10-26 14:04:44 -0500
committerFlorian Rathgeber <florian.rathgeber@gmail.com>2013-10-26 14:04:44 -0500
commit016ec9751463a171fa2e2580b3098a2f1967b677 (patch)
treecaed8bbf4f23c5ec7553428f2db07bc2746daf34
parentac55c9d4194a6aff02611c23d7107fba533690a0 (diff)
downloadflake8-016ec9751463a171fa2e2580b3098a2f1967b677.tar.gz
Git and Mercurial hooks respect FLAKE8_IGNORE
-rw-r--r--flake8/hooks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/flake8/hooks.py b/flake8/hooks.py
index 90f1d87..9dddecd 100644
--- a/flake8/hooks.py
+++ b/flake8/hooks.py
@@ -177,10 +177,11 @@ from flake8.hooks import git_hook
COMPLEXITY = os.getenv('FLAKE8_COMPLEXITY', 10)
STRICT = os.getenv('FLAKE8_STRICT', False)
+IGNORE = os.getenv('FLAKE8_IGNORE')
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'):
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+'))