Argument Clinic does not check the length of parameter descriptions
还没有人认领这个 Issue。
- 主要语言
- 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 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中展示的 Argument Clinic docstring 行长度检查开始,并审查 #150285 的上下文。使用列出的受影响函数,包括 bytes.split 和 bytes.rsplit 这样的克隆函数对,验证是否能检测到过长的参数描述,以及链接的 PR gh-155251 是否体现了已完成的行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100