From eeda99c492d936fb670fe2df1419d066ef149204 Mon Sep 17 00:00:00 2001 From: John-Scott Atlakson <24574+jsma@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:42:03 +0900 Subject: [PATCH] Added basic contributing notes Refs #55 --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index b61a032..2dff442 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,49 @@ Make and run migrations: - This is likely because the URL in the JS does not match the URL of the footnotes view. Check the URL in `wagtail_footnotes/static/footnotes/js/footnotes.js` matches the URL you set. - `NoneType` error when rendering page. - Make sure you are rendering the field in the template using `{% include_block page.field_name %}` + +## Contributing + +All contributions are welcome! + +### Install + +To make changes to this project, first clone this repository: + +```sh +git clone git@github.com:torchbox/wagtail-footnotes.git +cd wagtail-footnotes +``` + +With your preferred virtualenv activated, install testing dependencies: + +```sh +pip install -e '.[testing]' -U +``` + +### pre-commit + +Note that this project uses [pre-commit](https://github.com/pre-commit/pre-commit). To set up locally: + +```shell +# if you don't have it yet, globally +$ pip install pre-commit +# go to the project directory +$ cd wagtail-footnotes +# initialize pre-commit +$ pre-commit install + +# Optional, run all checks once for this, then the checks will run only on the changed files +$ pre-commit run --all-files +``` + +### How to run tests + +Now you can run tests as shown below: + +```sh +tox +``` + +You can run tests for a specific environment `tox -e python3.11-django4.2-wagtail5.0`, or run a specific test +`tox -e python3.11-django4.2-wagtail5.0 tests.test.test_blocks.TestBlocks`