`mypy` does not report column and error end for `ignore-without-code`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Tái hiện báo cáo bằng ví dụ main.py được cung cấp và lệnh mypy --show-column-numbers --show-error-end, sau đó theo dõi cách chẩn đoán ignore-without-code được định dạng. Công việc được xem là hoàn tất khi chẩn đoán bao gồm các giá trị cột và error-end như mong đợi, trong khi đầu ra và phần tóm tắt hiện có vẫn chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Report
When calling mypy with --show-column-numbers --show-error-end the error end and column are reported.
To Reproduce
# main.py
# mypy: enable-error-code="ignore-without-code"
a: int = "a" # type: ignore
mypy --show-column-numbers --show-error-end main.py
Expected Behavior
Expected the output to contain column and error end numbers:
main.py:3:14:3:27: error: "type: ignore" comment without error code (consider "type: ignore[assignment]" instead) [ignore-without-code]
Found 1 error in 1 file (checked 1 source file)
The same way it is e.g. if the type ignore is removed in the example:
main.py:3:10:3:12: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
Found 1 error in 1 file (checked 1 source file)
Actual Behavior
No column or error end is included, only the line number:
main.py:3: error: "type: ignore" comment without error code (consider "type: ignore[assignment]" instead) [ignore-without-code]
Found 1 error in 1 file (checked 1 source file)
Calling mypy with only one of the flags results in the same behavior.
Your Environment
- Mypy version used: 2.3.0 (compiled)
- Mypy command-line flags: --show-column-numbers --show-error-end
- Mypy configuration options from
mypy.ini(and other config files): no configuration - Python version used: 3.14.6 / 3.12.13
- Ngôn ngữ chính
- Python
- Star
- 20.6k
- Fork
- 3.3k
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 56
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.
Issue khác của python/mypy
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug topic-configuration topic-error-reporting
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug topic-attrs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Issue tương tự
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Đang mởarea: ci bug perceived difficulty: 3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ClickHouse/clickhouse-connect#1057 ·