Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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:70' | 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. test:
  28. python runtests.py
  29. coverage:
  30. coverage run --source wagtail runtests.py
  31. coverage report -m
  32. coverage html
  33. open coverage_html_report/index.html