Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 black, flake8, sort python with isort, indent html, and lint frontend css/js"
  6. @echo "format - enforce a consistent code style across the codebase, sort python files with isort 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. black --target-version py37 --check --diff .
  18. flake8
  19. isort --check-only --diff .
  20. semgrep --config .semgrep.yml --error .
  21. curlylint --parse-only wagtail
  22. git ls-files '*.html' | xargs djhtml --check
  23. lint-client:
  24. npm run lint:css --silent
  25. npm run lint:js --silent
  26. npm run lint:format --silent
  27. lint-docs:
  28. doc8 docs
  29. lint: lint-server lint-client lint-docs
  30. format-server:
  31. black --target-version py37 .
  32. isort .
  33. git ls-files '*.html' | xargs djhtml -i
  34. format-client:
  35. npm run format
  36. npm run fix:js
  37. format: format-server format-client
  38. test:
  39. python runtests.py
  40. coverage:
  41. coverage run --source wagtail runtests.py
  42. coverage report -m
  43. coverage html
  44. open coverage_html_report/index.html