Merge remote-tracking branch 'origin/gh/2'

This commit is contained in:
Ian Cordasco 2015-03-06 23:04:49 -06:00
commit c084211e9e
2 changed files with 104 additions and 1 deletions

View file

@ -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: