# HG changeset patch # User Oben Sonne # Date 1479335555 -3600 # Wed Nov 16 23:32:35 2016 +0100 # Node ID 8edea73f68fd0199bcc6778a2ee370bcad7799cd # Parent 23193a65dfbbaa2526124a1aab26782795a95ca9 add isort target diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -93,6 +93,12 @@ endef export HGIGNORE +define REQUIREMENTS +isort +nose +endef +export REQUIREMENTS + .hgignore: @echo "$$HGIGNORE" > $@ @@ -100,7 +106,7 @@ @echo "$$SETUP" > $@ requirements.txt: - echo nose > $@ + echo "$$REQUIREMENTS" > $@ src/$(APP): mkdir -p $@ @@ -134,6 +140,17 @@ build: env/_done_install # ============================================================================= +# utils +# ============================================================================= + +.PHONY: isort +isort: + CPF=`hg st -nam | grep '\.py'`; \ + test -n "$$CPF"\ + && env/bin/isort --line-width 80 --order-by-type -m 5 $$CPF \ + || echo "nothing to do (no changed python files)" + +# ============================================================================= # tests # =============================================================================