Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. curlylint --parse-only wagtail
  20. git ls-files '*.html' | xargs djhtml --check
  21. npm run lint:css --silent
  22. npm run lint:js --silent
  23. npm run lint:format --silent
  24. doc8 docs
  25. format:
  26. black --target-version py37 .
  27. isort .
  28. git ls-files '*.html' | xargs djhtml -i
  29. npm run format
  30. npm run fix:js
  31. test:
  32. python runtests.py
  33. coverage:
  34. coverage run --source wagtail runtests.py
  35. coverage report -m
  36. coverage html
  37. open coverage_html_report/index.html