summaryrefslogtreecommitdiff
path: root/flake8/hooks.py
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2015-03-06 23:04:49 -0600
committerIan Cordasco <graffatcolmingov@gmail.com>2015-03-06 23:04:49 -0600
commitc084211e9e9c48fc40ff2c33a9a4fc69960445ea (patch)
tree329404f7806694a542dd29ad0cdeb6df1795ddba /flake8/hooks.py
parent500a64f040767ec143b6d0f9549242b5aa307665 (diff)
parent54946334db0b72240e17e9bd63354820e6394b3f (diff)
downloadflake8-c084211e9e9c48fc40ff2c33a9a4fc69960445ea.tar.gz
Merge remote-tracking branch 'origin/gh/2'
Diffstat (limited to 'flake8/hooks.py')
-rw-r--r--flake8/hooks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/flake8/hooks.py b/flake8/hooks.py
index 46473d6..125e3cb 100644
--- a/flake8/hooks.py
+++ b/flake8/hooks.py
@@ -48,12 +48,18 @@ def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
if complexity > -1:
options['max_complexity'] = complexity
+ tmpdir = mkdtemp()
+
flake8_style = get_style_guide(config_file=DEFAULT_CONFIG, paths=['.'],
**options)
+ # Since we use a temporary directory, the exclude path needs to be fixed
+ # to prepend that.
+ path_join = os.path.join
+ flake8_style.options.exclude = [path_join(tmpdir, x) if "/" in x else x
+ for x in flake8_style.options.exclude]
filepatterns = flake8_style.options.filename
# Copy staged versions to temporary directory
- tmpdir = mkdtemp()
files_to_check = []
try:
for file_ in files_modified: