Decouple and unify PEP header processing for rendering, PEP 0, JSON, RSS and linting
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 30/100
- Issue 類型
- 重構
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 領域
- documentation, tooling
研究方向
先檢視 #2584、#2585 和 #2579,因為這項工作依賴於它們。接著比較 pep_zero_generator.parser、pep_processor.transforms.header_transform 以及 .pre-commit-config.yaml 中的 pygrep hooks;當 PEP 渲染、PEP 0、JSON、RSS 和 linting 一致使用一種結構化 header 格式時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
As a followup to #2584 and #2585 and as I've already been thinking about lately and discussed with @JelleZijlstra and @warsaw at PyCon, right now we parse the headers three different places with three different sets of logic:
pep_zero_generator.parserfor PEP 0, the JSON and the RSS with some additional sub-parsing in those callerspep_processor.transforms.header_transformfor the PEP renderingThe .pre-commit-config.yamlpygrep hooks for linting),
Instead, we should just use the structured format I suggest in #2584 (with the parsing presumably in the PEP class) for all of them (starting with PEP rendering initially), for several reasons:
- Simpler, more DRY, reliable and maintainable in the long run
- Easier to add new headers in one central place, as in #2572
- Enables simplifying/loosening the allowed input syntax for authors without fear of breaking anything
- Simplifies adding requested features in the various outputs (e.g.
:abbr:from #2514 ) - Decouples the header format from reST/Sphinx and ensures the format-independence @AA-Turner originally wanted in #2358
- Avoids cryptic regexes for linting (as @hugovk requested on #2484)
Of course, we should decide on and implement the structured format proposed in #2584 first, as it is a perquisite for this (alongside the changes in #2585 and #2579 needing to be merged before work on this begins), but I've opened this to keep track of it.
- 主要語言
- reStructuredText
- 星號
- 5k
- 分支
- 1.8k
- 平均合併
- 2 天 4 小時
- 30 天內合併 PR
- 25
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/peps 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 65/100
-
New PEP Editors? 未關閉meta
難度 5/5 一週以上 新手友好度 25/100
-
infra
難度 3/5 1-2 天 新手友好度 55/100
-
難度 2/5 1-3 小時 新手友好度 48/100
相似的 Issue
-
documentation
難度 2/5 1-3 小時 新手友好度 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
難度 2/5 1-3 小時 新手友好度 90/100
-
priority-0
難度 2/5 1-3 小時 新手友好度 68/100
-
sync-en
難度 1/5 1-3 小時 新手友好度 88/100
-
sync-en
難度 1/5 1-3 小時 新手友好度 88/100