Contributing to Kapowarr consists of 5 steps, listed hereunder.
- Make a contributing request, where you describe what you plan on doing. This request needs to get approved before you can start, or your pull request won't be accepted. This is to avoid multiple people from doing the same thing and to avoid you wasting your time if we do not wish the changes. This is also where discussions can be held about how something will be implemented.
- When the request is accepted, start your local development (more info about this below).
- When done, create a pull request to the development branch, where you mention again what you've changed/added and give a link to the original contributing request issue.
- The PR will be reviewed and if requested, changes will need to be made before it is accepted.
- When everything is okay, the PR will be accepted and you'll be done!
Once your request is accepted, you can start your local development.
- Clone the repository onto your computer and open it using your preferred IDE (Visual Studio Code is used by us).
- Make the changes needed and write accompanying tests if needed.
- Check if the code written follows the styling guide below.
- Run the finished version, using python 3.8, to check if you've made any errors.
- Run the tests (unittest is used). This can be done with a button click within VS Code, or with the following command where you need to be inside the root folder of the project:
python3 -m unittest discover -s ./tests -p '*.py'
- Test your version thoroughly to catch as many bugs as possible (if any).
The code of Kapowarr is written in such way that it follows the following rules. Your code should too.
- Compatible with python 3.8 to 3.11 .
- Tabs (4 space size) are used for indentation.
- Use type hints as much as possible. If you encounter an import loop because something needs to be imported for type hinting, utilise
typing.TYPE_CHECKING
. - Each function in the backend needs a doc string describing the function, what the inputs are, what errors could be raised from within the function and what the output is.
- The imports need to be sorted (the extension
isort
is used in VS Code). - The code needs to be compatible with Linux, MacOS, Windows and the Docker container.
- The code should, though not strictly enforced, reasonably comply with the rule of 80 characters per line.