realpython / realpython/python-guide
Recommended autoformatters?
還沒有人認領這個 Issue。
- 主要語言
- Batchfile
- 星號
- 29.8k
- 分支
- 5.9k
- PR 合併指標
- 30 天內沒有已合併 PR
描述
In the Code Style document https://github.com/realpython/python-guide/blob/master/docs/writing/style.rst there's a small mention of autopep8 which can be used to format code to meet PEP8 standards. But there's at least two other autoformatters (black and yapf) which are as good if not better. There's a blog comparing the three here: https://medium.com/3yourmind/auto-formatters-for-python-8925065f9505
The gist of it is: autopep8 is the most conservative, black is the most opinionated, and yapf is somewhere in between depending on how you configure it.
Should the python guide have an opinion on which auto formatters should be used? In addition to the current mention of autopep8. I think it would be good to expand this section; auto formatters are quite useful and of great interest to developers coming from tools like gofmt and prettier.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 docs/writing/style.rst 中現有的 autopep8 提及處開始,然後查看所連結的 autopep8、black 與 yapf 比較。更新 Code Style 文件,加入關於這些格式化工具的指引以及明確的建議或比較;該區段應說明開發者如何選擇 autoformatter。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100