Your contribution is very welcome! These are some guidelines to ensure that your changes are quickly accepted.
The goal is to write code that works, is secure and easy to read and understand. To achieve that:
- limit the length of the lines of code to 80 chars (well, you don't need to worry about that as long as you use the pre-commit check);
- use typing annotation for all the functions and methods you write;
- document every public method and module using google style docstring;
- write
pytest
tests to ensure a 100% coverage.
Install poetry
, and pre-commit
in your default python (3.7+) distribution:
pip install poetry pre-commit
Use git
to clone the repo and enter the newly created directory:
git clone https://github.com/sanzoghenzo/wsl-tools
cd wsl-tools
Simply run the following:
poetry install
It will create the virtualenv and install the dependencies.
!!! NOTE If you use conda, the command will use the currently active environment.
To ensure an isolated environment,
you should run `conda create -n wsl-tools python=3.7 poetry`
and `conda activate wsl-tool` before `poetry install`.
This will ensure that your code is checked before committing the changes:
pre-commit install
To run the test suite, simply run:
poetry run pytest
You can manunally perform the checks that run before a commit via pre commit --all-files
.
This will:
- auto-format code and docstrings;
- perform static and runtime type checking;
- run security check on the dependencies;
- run the tests and check there's 100% coverage.