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
-
Area: Excel support
难度 2/5 1-3 小时 新手友好度 75/100
orbeon/orbeon-forms#7893 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
docToolchain/docToolchain#1705 ·
-
kb-infra-drift
难度 2/5 1-3 小时 新手友好度 70/100
OCHA-DAP/ds-knowledge-base#653 · 1 条评论 ·
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
namespace operations
难度 1/5 1 小时以内 新手友好度 90/100
EclipseFdn/open-vsx.org#13419 ·