django-basket-c21/Makefile

24 lignes
756 B
Makefile

# Makefile
.PHONY: help lint
# commentaire d'une cible : #-> interne ##-> aide production+dev ###-> aide dev
help: ## affiche cette aide
@perl -nle'print $& if m{^[a-zA-Z_-]+:[^#]*?###? .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?###? "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
# dev
lint: ### vérifie la syntaxe et le code python
which black > /dev/null && black --check --config black.toml . ; true
python -m isort --check --recursive . ; true
flake8 .
@echo "check debug flag"
! git grep -Ee '^[^#]*(DBG|pdb\.set_trace).*$$' '*.py'
! git grep -Ee 'DBG' '*.html'
black: ### passe le formateur
which black > /dev/null && black --config black.toml . ; true
isort: ### tri les import
python -m isort --recursive . ; true