Code source de Weblate¶
Weblate est développé sur GitHub. Vous êtes bienvenu pour bifurquer le code et ouvrir des demandes de tirage. Les correctifs sous toute autre forme sont également les bienvenus.
Voir aussi
Extraire Weblate internals pour voir à quoi ressemble Weblate de l’intérieur.
Règles de codage¶
Any code for Weblate should be written with Security by Design Principles in mind.
Any code should come with documentation explaining the behavior. Don’t forget documenting methods, complex code blocks, or user visible features.
Any new code should utilize PEP 484 type hints. We’re not checking this in our CI yet as existing code does not yet include them.
Git commits should follow Conventional Commits specification.
Coding standard and linting the code¶
The code should follow PEP-8 coding guidelines and should be formatted using ruff code formatter.
To check the code quality, you can use ruff, its configuration is
stored in pyproject.toml
.
The easiest approach to enforce all this is to install pre-commit. The
repository contains configuration for it to verify the committed files are sane.
After installing it (it is already included in the
pyproject.toml
) turn it on by running pre-commit install
in
Weblate checkout. This way all your changes will be automatically checked.
You can also trigger check manually, to check all files run:
pre-commit run --all