Argument Clinic does not check the length of parameter descriptions
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
The docstring line length check is performed before the parameter descriptions are added to the docstring:
max_width = f.docstring_line_width
summary_len = len(lines[0])
max_body = max(map(len, lines[1:]))
...
if not parameters_marker_count:
lines.insert(2, '{parameters}')
So a description of any length is accepted without a warning.
24 functions in the current tree have parameter description lines longer than the limit (the number of too long lines is in parentheses):
_lzma.LZMADecompressor(4)select.epoll(3)int.to_bytes(2)select.kqueue.control(2)str.encode(2)winreg.SetValueEx(2)_sqlite3.Connection.getconfig_sqlite3.Connection.setconfig_sre.template_winapi.RegisterEventSource_zstd.ZstdCompressor.set_pledged_input_sizebytearray.decodebytearray.rsplitbytearray.splitbytearray.take_bytesbytes.decodebytes.rsplitbytes.splitgc.set_debugos.timerfd_createselect.poll.pollwinreg.ConnectRegistrywinreg.DeleteTreezlib._ZlibDecompressor
This is easy to miss for a cloned function, which inherits the descriptions of the function it clones: bytes.split and bytes.rsplit (and the bytearray pair) both have a 69 character line, and rewrapping the description in bytes.split does not make Argument Clinic report anything for either of them.
This is a leftover of #150285.
Linked PRs
- gh-155251
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
issue に示されている Argument Clinic docstring の行長チェックから始め、#150285 のコンテキストを確認します。bytes.split や bytes.rsplit のようなクローンされたペアを含む、一覧にある影響を受ける関数を使って、長すぎるパラメーター説明が検出されることと、リンクされた PR gh-155251 が完了した動作を反映していることを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100