| 1 | # Contributing |
| 2 | |
| 3 | Pull requests are welcome, but please ensure they are supported by at least 1 open Issue ticket describing |
| 4 | the objectives of the PR. |
| 5 | |
| 6 | ## Setup |
| 7 | |
| 8 | This project uses [poetry]. Have it installed and setup first. |
| 9 | |
| 10 | To install dev-dependencies and tools: |
| 11 | |
| 12 | ```shell |
| 13 | poetry install |
| 14 | ``` |
| 15 | |
| 16 | ## Code style |
| 17 | |
| 18 | This project uses [PEP8] Style Guide for Python Code. |
| 19 | This project loves sorted imports. |
| 20 | Get it all applied via: |
| 21 | |
| 22 | ```shell |
| 23 | poetry run isort . |
| 24 | poetry run autopep8 -ir requirements/ tests/ |
| 25 | ``` |
| 26 | |
| 27 | This project prefers `f'strings'` over `'string'.format()`. |
| 28 | This project prefers `'single quotes'` over `"double quotes"`. |
| 29 | This project prefers `lower_snake_case` variable names. |
| 30 | |
| 31 | ## Documentation |
| 32 | |
| 33 | This project uses [Sphinx] to generate documentation which is automatically published to [readthedocs.io]. |
| 34 | |
| 35 | Source for documentation is stored in the `docs` folder in [RST] format. |
| 36 | |
| 37 | You can generate the documentation locally by running: |
| 38 | |
| 39 | ```shell |
| 40 | cd docs |
| 41 | pip install -r requirements.txt |
| 42 | make html |
| 43 | ``` |
| 44 | |
| 45 | ## Testing |
| 46 | |
| 47 | Run all tests in dedicated environments, via: |
| 48 | |
| 49 | ```shell |
| 50 | poetry run tox run |
| 51 | ``` |
| 52 | |
| 53 | ## Sign off your commits |
| 54 | |
| 55 | Please sign off your commits, to show that you agree to publish your changes under the current terms and licenses of the project |
| 56 | , and to indicate agreement with [Developer Certificate of Origin (DCO)](https://developercertificate.org/). |
| 57 | |
| 58 | ```shell |
| 59 | git commit --signed-off ... |
| 60 | ``` |
| 61 | |
| 62 | ## Pre-commit hooks |
| 63 | |
| 64 | If you like to take advantage of [pre-commit hooks], you can do so to cover most of the topics on this page when |
| 65 | contributing. |
| 66 | |
| 67 | ```shell |
| 68 | pre-commit install |
| 69 | ``` |
| 70 | |
| 71 | All our pre-commit checks will run locally before you can commit! |
| 72 | |
| 73 | [poetry]: https://python-poetry.org |
| 74 | [PEP8]: https://www.python.org/dev/peps/pep-0008 |
| 75 | [Sphinx]: https://www.sphinx-doc.org/ |
| 76 | [readthedocs.io]: https://requirements-parser.readthedocs.io/ |
| 77 | [RST]: https://en.wikipedia.org/wiki/ReStructuredText |
| 78 | [pre-commit hooks]: https://pre-commit.com |