To contribute, install the repository locally, create your own branch, add your code (and tests, and documentation), and open a PR !

Pre-commit hooks

Pre-commit hooks are set to check the code added whenever you commit something.

If you never ran the hooks before, install it with :

pre-commit install

Then you can just try to commit your code. If your code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !


You can manually run the pre-commit hooks with :

pre-commit run --all-files

Tests

When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !

You can run the tests with :

pytest

You can generate an HTML code report by running :

pytest --cov-report=html

And then open the file htmlcov/index.html in your browser !


Tests are not included in the pre-commit hooks, because running the tests take some time, and for the sake of developpers we want the pre-commit hooks to be fast !