python / python/peps

Decouple and unify PEP header processing for rendering, PEP 0, JSON, RSS and linting

オープン
#2,587 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

infra
主要言語
reStructuredText
スター
5k
フォーク
1.8k
平均マージ
2日 4時間
マージ済み PR(30日)
25

説明

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.parser for PEP 0, the JSON and the RSS with some additional sub-parsing in those callers
  • pep_processor.transforms.header_transform for the PEP rendering
  • The .pre-commit-config.yaml pygrep 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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

この作業は #2584、#2585、#2579 に依存しているため、まずこれらをレビューしてください。次に、pep_zero_generator.parser、pep_processor.transforms.header_transform、.pre-commit-config.yaml の pygrep hooks を比較してください。PEP のレンダリング、PEP 0、JSON、RSS、linting で、1つの構造化されたヘッダー形式が一貫して使用されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

領域
documentation, tooling
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。