mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-08 05:54:17 +00:00
Merge remote-tracking branch 'origin/gh/2'
This commit is contained in:
commit
c084211e9e
2 changed files with 104 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue