2
0

Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .PHONY: clean-pyc develop lint-server lint-client lint-docs lint format-server format-client format test coverage
  2. help:
  3. @echo "clean-pyc - remove Python file artifacts"
  4. @echo "develop - install development dependencies"
  5. @echo "lint - check style with ruff, sort python with ruff, indent html, and lint frontend css/js"
  6. @echo "format - enforce a consistent code style across the codebase, sort python files with ruff and fix frontend css/js"
  7. @echo "test - run tests"
  8. @echo "coverage - check code coverage"
  9. clean-pyc:
  10. find . -name '*.pyc' -exec rm -f {} +
  11. find . -name '*.pyo' -exec rm -f {} +
  12. find . -name '*~' -exec rm -f {} +
  13. develop: clean-pyc
  14. pip install -e .[testing,docs]
  15. npm install --no-save && npm run build
  16. lint-server:
  17. ruff format --check .
  18. ruff check .
  19. curlylint --parse-only wagtail
  20. git ls-files '*.html' | xargs djhtml --check
  21. semgrep --config .semgrep.yml --error .
  22. lint-client:
  23. npm run lint:css --silent
  24. npm run lint:js --silent
  25. npm run lint:format --silent
  26. lint-docs:
  27. doc8 docs
  28. lint: lint-server lint-client lint-docs
  29. format-server:
  30. ruff check . --fix
  31. ruff format .
  32. git ls-files '*.html' | xargs djhtml
  33. format-client:
  34. npm run format
  35. npm run fix:js
  36. format: format-server format-client
  37. test:
  38. python runtests.py
  39. coverage:
  40. coverage run --source wagtail runtests.py
  41. coverage report -m
  42. coverage html
  43. open coverage_html_report/index.html