playbook/docs/python/style_guide.md

15 lines
616 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Python 代码风格Google Python Style Guide
本 Playbook 的 Python 代码风格以 Google Python Style Guide 为基线(基于 PEP 8
- Google Python Style Guide: https://google.github.io/styleguide/pyguide.html
- PEP 8: https://peps.python.org/pep-0008/
## 项目约定Project Conventions
- 行宽80`black`/`flake8`/`pylint` 配置保持一致)
- docstringGoogle 风格(与 `.flake8``docstring-convention = google` 对齐)
- import 顺序:使用 `isort``profile = google`
当既有代码与本约定冲突时,优先保持局部一致性,逐步迁移。