git_hook: Only check staged changes for compliance

This commit is contained in:
Christoph Rauch 2012-06-14 14:04:42 +02:00
parent 30d3fd0f16
commit 3438b55c1a

View file

@ -120,7 +120,7 @@ def git_hook(complexity=-1, strict=False):
_initpep8()
warnings = 0
_, files_modified, _ = run("git diff-index --name-only HEAD")
_, files_modified, _ = run("git diff-index --cached --name-only HEAD")
for filename in files_modified:
ext = os.path.splitext(filename)[-1]
if ext != '.py':