Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .PHONY: clean-pyc develop lint test coverage
  2. help:
  3. @echo "clean-pyc - remove Python file artifacts"
  4. @echo "develop - install development dependencies"
  5. @echo "lint - check style with black, flake8, sort python with isort, indent html, and lint frontend css/js"
  6. @echo "test - run tests"
  7. @echo "coverage - check code coverage"
  8. clean-pyc:
  9. find . -name '*.pyc' -exec rm -f {} +
  10. find . -name '*.pyo' -exec rm -f {} +
  11. find . -name '*~' -exec rm -f {} +
  12. develop: clean-pyc
  13. pip install -e .[testing,docs]
  14. npm install --no-save && npm run build
  15. lint:
  16. black --target-version py37 --check --diff .
  17. flake8
  18. isort --check-only --diff .
  19. # Filter out known false positives, while preserving normal output and error codes.
  20. # See https://github.com/motet-a/jinjalint/issues/18.
  21. jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:76' | tee /dev/tty | wc -l | grep -q '0'
  22. git ls-files '*.html' | xargs djhtml --check
  23. npm run lint:css --silent
  24. npm run lint:js --silent
  25. npm run lint:format --silent
  26. doc8 docs
  27. format:
  28. black --target-version py37 .
  29. isort .
  30. git ls-files '*.html' | xargs djhtml -i
  31. npm run format
  32. npm run fix:js
  33. test:
  34. python runtests.py
  35. coverage:
  36. coverage run --source wagtail runtests.py
  37. coverage report -m
  38. coverage html
  39. open coverage_html_report/index.html