Weblate 源代码

Weblate 在 GitHub 上开发。欢迎您将代码复刻并开一个拉取请求。同样欢迎任何形式的补丁。

参见

查阅 Weblate 内部 来看看 Weblate 内部是什么样子的。

Coding guidelines

在为 Weblate 编写任何代码时都应该考虑到 通过设计保证安全原则

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.

Coding standard and linting the code

代码应该符合 PEP-8 编码准则,并且应该使用 black 代码格式化程序来格式化。

为了检查代码质量,可以使用 flake8,推荐的插件列在 .pre-commit-config.yaml 中,而其配置放置在 setup.cfg 中。

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 requirements-lint.txt) turn it on by running pre-commit install in Weblate checkout. This way all your changes will be automatically checked.

还能够手动触发检查,来检查所有文件的运行:

pre-commit run --all