diff --git a/Makefile.python b/Makefile.python --- a/Makefile.python +++ b/Makefile.python @@ -32,6 +32,12 @@ check-codespell: find . -name '*.py' | xargs $(CODESPELL) $(CODESPELLFLAGS) +.PHONY: check-staged +check-staged: + git diff -z --staged --name-only -- '*.py' \ + | xargs -0 -L1 -i'{}' /bin/sh -c \ + "git show ':{}' | $(FLAKE) $(FLAKEFLAGS) --stdin-display-name '{}' -" + .PHONY: lint lint: $(LINT) $(LINTFLAGS) $(PYMODULE) diff --git a/bin/git-add-pre-commit-hook b/bin/git-add-pre-commit-hook --- a/bin/git-add-pre-commit-hook +++ b/bin/git-add-pre-commit-hook @@ -13,7 +13,7 @@ if ! [ -x "$HOOK" ] ; then cat > "$HOOK" <