Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # ---------- ---------- ---------- ---------- ---------- ----------
  2. #
  3. # django_sso
  4. #
  5. # 1) config, vars, and target
  6. # 2) functions
  7. # 3) phonies
  8. #
  9. # ---------- ---------- ---------- ---------- ---------- ----------
  10. NAME=django_sso
  11. target: help
  12. # ---------- ---------- ---------- ---------- ---------- ----------
  13. # functions
  14. # ---------- ---------- ---------- ---------- ---------- ----------
  15. define fix-python
  16. @isort . || echo "isort returned nonzero"
  17. @black . || echo "black returned nonzero"
  18. endef
  19. define lint
  20. @ruff check . || echo "ruff returned nonzero"
  21. endef
  22. define lint-types
  23. @mypy . || echo "mypy returned nonzero"
  24. endef
  25. define find-cve
  26. @pip-audit || echo "pip-audit returned nonzero"
  27. endef
  28. # ---------- ---------- ---------- ---------- ---------- ----------
  29. # phonies
  30. # ---------- ---------- ---------- ---------- ---------- ----------
  31. .PHONY: help
  32. help:
  33. @echo "Usage: make [PHONY]"
  34. @sed -n -e "/sed/! s/\.PHONY: //p" Makefile
  35. @echo ""
  36. .PHONY: clean
  37. clean:
  38. @py3clean ./src/ ./tests/ || echo "pyclean not installed"
  39. @rm -rf var/ .mypy_cache/
  40. .PHONY: fix-python
  41. fix-python:
  42. @$(call fix-python)
  43. .PHONY: fix-all
  44. fix-all: fix-python
  45. .PHONY: lint
  46. lint:
  47. @$(call lint)
  48. .PHONY: lint-types
  49. lint-types:
  50. @$(call lint-types)
  51. .PHONY: find-cve
  52. find-cve:
  53. @$(call find-cve)
  54. .PHONY: dev
  55. dev: fix-all lint lint-types find-cve test
  56. .PHONY: test
  57. test:
  58. @coverage run --source='.' -m unittest discover -s tests.django_sso_tests -t .
  59. @coverage report -m