Coding style#
Python code#
All python code shall follow PEP 8. Currently, not yet all python code follows this strictly but this is about to change.
Further, Ruff with the default linting and formatting rules is used to do linting and to check formatting in the CI/CD pipelines. Thus, it is highly recommended to adhere to these rules for future code as this a requirement for the acceptance of a MR.
Shell code#
All shell code is required to run with bash. Coding style shall adhere close to present code.
Using Ruff with pre-commit#
This is a quick start guide to set up Ruff with pre-commit to do automatic linting and formatting on each git commit. You should install Ruff and pre-commit. Then you need to install the pre-commit configuration of the auto-icon project in your local repository. In your repository, execute:
pip install ruff pre-commit
pre-commit install
Tip
There is a Ruff extension for Visual Studio Code.
See also
Install Ruff and pre-commit