Argument Clinic does not check the length of parameter descriptions
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với kiểm tra độ dài dòng của docstring của Argument Clinic được nêu trong issue và xem xét ngữ cảnh từ #150285. Sử dụng các hàm bị ảnh hưởng được liệt kê, bao gồm các cặp được sao chép như bytes.split và bytes.rsplit, để xác minh rằng các mô tả tham số quá dài được phát hiện và PR được liên kết gh-155251 phản ánh hành vi đã hoàn tất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100