Add built-in validation checks for directive syntax
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
issue にリンクされている既存の組み込みバリデーションチェックを確認し、無効なディレクティブと修正済みディレクティブの例と動作を比較します。インデントされていないディレクティブコンテンツブロックのバリデーションを追加し、提案された診断が報告される一方で、正しくインデントされた構文は受け入れられることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Issue/bug
Currently, the following invalid directive syntax is not checked by numpydoc-validation
.. directive::
Some text
The numpydoc-validation checks will pass, but the invalid syntax will result in a documentation build failure with a warning and/or error such as:
WARNING: Explicit markup ends without a blank line; unexpected unindent.
ERROR: Content block expected for the "note" directive; none found.
The correct syntax, according to the reST documentation, is:
+-------+-------------------------------+
| ".. " | directive type "::" directive |
+-------+ block |
| |
+-------------------------------+
Therefore, in the first example provided above, the errors/warnings are resolved by indenting the block of text, i.e.:
.. directive::
Some text
Here is an example build failure and the subsequent commit diff with added indentation which resolved the warnings and errors and resulted in a successful documentation build. Ideally, this invalid syntax would have been caught by a pre-commit hook such as numpydoc-validation so that it could be addressed before running CI testing to avoid the inevitable documentation build failure.
This appears to be a somewhat common problem, e.g. reported here and here.
Feature request
The feature request is to add additional validation check(s) for the correct syntax of directives, e.g. add a new mapping to the existing checks, something like:
- "GL11": "reST directives {directives} text block must be indented."
Thank you for your time.
- 主要言語
- Python
- スター
- 354
- フォーク
- 185
- 平均マージ
- 4分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
numpy/numpydoc のほかの issue
-
Don't require ``RT01`` for properties再び着手できるかも @Nani-2007-code が 30 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
-
DOC: Version link overflowing on navbar再び着手できるかも @swoyer2 が 52 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
needs-decision
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
reflex-dev/reflex#8026 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
superlinked/sie#1033 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/ponymail-foal#365 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
NousResearch/hermes-labs-plugins#116 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
gcivil-nyu-org/team-3-fall26#192 ·
メンテナーはふだん 1 日以内に返信