Squashed 'docs/standards/playbook/' content from commit e504a68

git-subtree-dir: docs/standards/playbook
git-subtree-split: e504a689dcf2e2fdeeb64097930347d504e68f5f
This commit is contained in:
csh
2025-12-14 17:55:55 +08:00
commit eada742d75
49 changed files with 2756 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# Python 工具链(Tooling
本 Playbook 推荐用以下工具保证代码一致性与质量:
- `black`:格式化(行宽 80
- `isort`import 排序(Google profile
- `flake8`:风格检查 + docstring 约定
- `pylint`:静态检查(以 `.pylintrc` 为准,可按项目调整)
- `mypy`:类型检查(可选)
- `pytest`:测试(可选)
- `pre-commit`:在 `git commit` 前自动运行上述检查/格式化(可选,但推荐)
## 常用命令(示例)
安装工具(示例,按项目实际依赖管理方式调整):
```bash
python -m pip install black isort flake8 pylint mypy pytest pre-commit
```
格式化与检查(示例):
```bash
black .
isort .
flake8 .
pylint .
mypy .
pytest
```
启用 `pre-commit`(只需一次):
```bash
pre-commit install
```