2022-09-23 12:52:29 +00:00
|
|
|
.PHONY: clean-pyc develop lint-server lint-client lint-docs lint format-server format-client format test coverage
|
2014-02-07 15:20:27 +00:00
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "clean-pyc - remove Python file artifacts"
|
2021-04-21 20:37:06 +00:00
|
|
|
@echo "develop - install development dependencies"
|
2023-11-16 23:42:29 +00:00
|
|
|
@echo "lint - check style with ruff, sort python with ruff, indent html, and lint frontend css/js"
|
2023-04-08 15:34:23 +00:00
|
|
|
@echo "format - enforce a consistent code style across the codebase, sort python files with ruff and fix frontend css/js"
|
2021-04-21 20:37:06 +00:00
|
|
|
@echo "test - run tests"
|
|
|
|
@echo "coverage - check code coverage"
|
2014-02-07 15:20:27 +00:00
|
|
|
|
|
|
|
clean-pyc:
|
|
|
|
find . -name '*.pyc' -exec rm -f {} +
|
|
|
|
find . -name '*.pyo' -exec rm -f {} +
|
|
|
|
find . -name '*~' -exec rm -f {} +
|
|
|
|
|
2016-06-14 09:39:45 +00:00
|
|
|
develop: clean-pyc
|
|
|
|
pip install -e .[testing,docs]
|
2019-03-21 20:41:14 +00:00
|
|
|
npm install --no-save && npm run build
|
2016-06-14 09:39:45 +00:00
|
|
|
|
2022-03-21 07:25:36 +00:00
|
|
|
lint-server:
|
2023-11-16 23:42:29 +00:00
|
|
|
ruff format --check .
|
2023-04-08 15:34:23 +00:00
|
|
|
ruff check .
|
2022-05-20 16:16:51 +00:00
|
|
|
curlylint --parse-only wagtail
|
2022-02-12 01:04:21 +00:00
|
|
|
git ls-files '*.html' | xargs djhtml --check
|
2023-07-15 12:08:28 +00:00
|
|
|
semgrep --config .semgrep.yml --error .
|
2022-03-21 07:25:36 +00:00
|
|
|
|
|
|
|
lint-client:
|
2017-08-18 00:28:38 +00:00
|
|
|
npm run lint:css --silent
|
|
|
|
npm run lint:js --silent
|
2022-02-04 11:45:08 +00:00
|
|
|
npm run lint:format --silent
|
2022-03-21 07:25:36 +00:00
|
|
|
|
|
|
|
lint-docs:
|
2020-10-21 11:38:52 +00:00
|
|
|
doc8 docs
|
2014-02-07 15:20:27 +00:00
|
|
|
|
2022-03-21 07:25:36 +00:00
|
|
|
lint: lint-server lint-client lint-docs
|
|
|
|
|
|
|
|
format-server:
|
2023-04-08 15:34:23 +00:00
|
|
|
ruff check . --fix
|
2023-11-16 23:42:29 +00:00
|
|
|
ruff format .
|
2023-10-30 15:49:41 +00:00
|
|
|
git ls-files '*.html' | xargs djhtml
|
2022-03-21 07:25:36 +00:00
|
|
|
|
|
|
|
format-client:
|
2022-02-24 17:20:35 +00:00
|
|
|
npm run format
|
|
|
|
npm run fix:js
|
|
|
|
|
2022-03-21 07:25:36 +00:00
|
|
|
format: format-server format-client
|
|
|
|
|
2014-02-07 15:20:27 +00:00
|
|
|
test:
|
2014-02-13 12:44:49 +00:00
|
|
|
python runtests.py
|
2014-02-07 15:20:27 +00:00
|
|
|
|
|
|
|
coverage:
|
2021-04-21 20:37:06 +00:00
|
|
|
coverage run --source wagtail runtests.py
|
2014-02-07 15:20:27 +00:00
|
|
|
coverage report -m
|
|
|
|
coverage html
|
2021-04-21 20:37:06 +00:00
|
|
|
open coverage_html_report/index.html
|