Page MenuHomeSoftware Heritage

D305.diff
No OneTemporary

D305.diff

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" <<EOF
#!/bin/sh
-make check
+make check-staged
EOF
chmod +x "$HOOK"
fi

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 3:57 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217918

Event Timeline