Thank you for taking the interest to contribute! There is always aspects of the library we can improve, so any contributions are welcome!
If you're only here to find out what programs you need to use when contributing, here is a list:
- prettier - Formatter for various other formats
For a more detailed description on why each of these are needed, scroll down to their specific sections.
Make sure no one has already started working on it. Once you do start working, it is good to add a comment to the issue to notify others.
You don't wanna work hours on code only for it to be thrown out because the maintainers didn't agree with it. To avoid doing so, raise an issue about your ideas.
If you aren't fixing a reported issue, start by raising a ticket yourself to make sure your changes are wanted.
Commit frequently, with each commit following a single major theme. Commits like made some changes
will not be accepted.
For your commit message, use a style that describes what it is going to do, not what it has already done.
For example:
added a new slider widget # Bad
Add a new slider widget # Good!
It is also important to capitalize the first letter of the text, and to not append a period to the end. Standard committing rules (50 character title, empty line separating title from body) apply.
We take code style very seriously. Your code should use and apply the tooling describe below, otherwise we cannot accept it.
PyTermGUI uses different formatters to keep the code consistent and improve readability. Here are the formatters you need on your system to contribute to pytermgui:
Formatter | Files |
---|---|
prettier | .md , .yml , .yaml |
black | .py |
prettier:
- Install nodejs and npm (npx comes with it)
black:
-
Install python and pip
-
Run the following command
pip install black
Run these commands to format your files.
It is common for developers to configure their IDEs to automatically format files as they are saved. See each tool for instructions on how to do so.
WARNING: These commands will overwrite your files.
prettier:
npx prettier --write .
black:
black .
PyTermGUI uses pylint to ensure any code is up to our standards. Any pushed code will be tested against the program in a GitHub action, and your changes will not be merged as long as the score is below 10.0.
- Install python and pip
- Run the following command
pip install pylint
pylint pytermgui
PyTermGUI uses Python's type hint system to improve readability and code stability. For this, we use the mypy static type checker. Your code needs to pass mypy with no errors in order to be merged.
- Install python and pip
- Install mypy using the following command
pip install mypy
mypy pytermgui