|
| 1 | +Contributing |
| 2 | +==================================================== |
| 3 | + |
| 4 | +Pull requests are welcome, but please read these contributing guidelines first. |
| 5 | + |
| 6 | +Setup |
| 7 | +---------------------------------------------------- |
| 8 | + |
| 9 | +This project uses `poetry`_. Have it installed and setup first. |
| 10 | + |
| 11 | +To install dev-dependencies and tools: |
| 12 | + |
| 13 | +.. code-block:: |
| 14 | +
|
| 15 | + poetry install |
| 16 | +
|
| 17 | +Code style |
| 18 | +---------------------------------------------------- |
| 19 | + |
| 20 | +This project uses `PEP8`_ Style Guide for Python Code. This project loves sorted imports. Get it all applied via: |
| 21 | + |
| 22 | +.. code-block:: |
| 23 | +
|
| 24 | + poetry run isort . |
| 25 | + poetry run autopep8 --in-place -r cyclonedx tests |
| 26 | +
|
| 27 | +
|
| 28 | +Documentation |
| 29 | +---------------------------------------------------- |
| 30 | + |
| 31 | +This project uses `Sphinx`_ to generate documentation which is automatically published to `readthedocs.io`_. |
| 32 | + |
| 33 | +Source for documentation is stored in the ``docs`` folder in `RST`_ format. |
| 34 | + |
| 35 | +You can generate the documentation locally by running: |
| 36 | + |
| 37 | +.. code-block:: |
| 38 | +
|
| 39 | + cd docs |
| 40 | + pip install -r requirements.txt |
| 41 | + make html |
| 42 | +
|
| 43 | +
|
| 44 | +Testing |
| 45 | +---------------------------------------------------- |
| 46 | + |
| 47 | +Run all tests in dedicated environments, via: |
| 48 | + |
| 49 | +.. code-block:: |
| 50 | +
|
| 51 | + poetry run tox |
| 52 | +
|
| 53 | +
|
| 54 | +Sign your commits |
| 55 | +---------------------------------------------------- |
| 56 | + |
| 57 | +Please sign your commits, to show that you agree to publish your changes under the current terms and licenses of the |
| 58 | +project. We can't accept contributions, however great, if you do not sign your commits. |
| 59 | + |
| 60 | +.. code-block:: |
| 61 | +
|
| 62 | + git commit --signed-off ... |
| 63 | +
|
| 64 | +
|
| 65 | +Pre-commit hooks |
| 66 | +---------------------------------------------------- |
| 67 | + |
| 68 | +If you like to take advantage of `pre-commit hooks`_, you can do so to cover most of the topics on this page when |
| 69 | +contributing. |
| 70 | + |
| 71 | +.. code-block:: |
| 72 | +
|
| 73 | + pre-commit install |
| 74 | +
|
| 75 | +All our pre-commit checks will run locally before you can commit! |
| 76 | + |
| 77 | + |
| 78 | +.. _poetry: https://python-poetry.org |
| 79 | +.. _PEP8: https://www.python.org/dev/peps/pep-0008 |
| 80 | +.. _Sphinx: https://www.sphinx-doc.org/ |
| 81 | +.. _readthedocs.io: https://cyclonedx-python-library.readthedocs.io/ |
| 82 | +.. _RST: https://en.wikipedia.org/wiki/ReStructuredText |
| 83 | +.. _pre-commit hooks: https://pre-commit.com |
0 commit comments