Weblate 源代码

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

参见

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

代码编写准则

在为 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 中。

将所有这些强制的最简单的方法是安装 pre-commit。仓库为此包含了配置,来确定提交的文件是正常的。安装后(他已经包括在 requirements-lint.txt 中了)通过在 Weblate 的付款台运行 pre-commit install 来将它打开。通过这种方法,所有更改都将被自动检查。

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

pre-commit run --all