(🐞) crash with `--pretty` from attrs raising an error in the wrong file
Đang mở
Chưa có ai nhận issue này.
crash
- Ngôn ngữ chính
- Python
- Star
- 20.6k
- Fork
- 3.3k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
> git clone https://github.com/DataDog/dd-trace-py
> cd dd-trace-py
> pip install -e .
> pip install mypy
> mypy --strict --check-untyped-defs | grep threading.py
ddtrace/profiling/collector/threading.py:25: error: Need type annotation for "recorder" [var-annotated]
ddtrace/profiling/collector/threading.py:29: error: Function is missing a type annotation for one or more arguments [no-untyped-def]
ddtrace/profiling/collector/threading.py:316: error: Need type annotation for "tracer" [var-annotated]
> mypy --strict --check-untyped-defs --pretty
...
File "mypy/main.py", line 100, in main
File "mypy/main.py", line 182, in run_build
File "mypy/build.py", line 192, in build
File "mypy/build.py", line 266, in _build
File "mypy/build.py", line 2942, in dispatch
File "mypy/build.py", line 3340, in process_graph
File "mypy/build.py", line 3465, in process_stale_scc
File "mypy/errors.py", line 915, in file_messages
File "mypy/errors.py", line 885, in format_messages
IndexError: list index out of range
threading.py:316: error, threading only has 43 lines in it.
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
Tái hiện lỗi crash bằng mypy --strict --check-untyped-defs --pretty sau khi làm theo các lệnh thiết lập trong issue. Bắt đầu từ mypy/errors.py, đặc biệt là format_messages và file_messages, rồi so sánh vị trí được báo cáo với các lỗi từ ddtrace/profiling/collector/threading.py; được xem là hoàn tất khi --pretty chạy xong mà không có IndexError và báo cáo các vị trí hợp lệ.
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
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100