mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-30 18:56:53 +00:00
Update hooks.py
Added --diff-filter to ignore deleted files.
This commit is contained in:
parent
57417b435a
commit
0f90a8aca5
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
|
|||
the files to the index before running a commit, e.g., git commit -a
|
||||
:returns: total number of errors if strict is True, otherwise 0
|
||||
"""
|
||||
gitcmd = "git diff-index --cached --name-only HEAD"
|
||||
gitcmd = "git diff-index --cached --name-only --diff-filter=ACMRTUXB HEAD"
|
||||
if lazy:
|
||||
# Catch all files, including those not added to the index
|
||||
gitcmd = gitcmd.replace('--cached ', '')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue