`mypy` does not report column and error end for `ignore-without-code`
まだ誰も着手していません。
評価
調査の方向性
示されている main.py の例と mypy --show-column-numbers --show-error-end コマンドを使って報告を再現し、その後、ignore-without-code 診断がどのようにフォーマットされるかを追跡します。診断に期待される列と error-end の値が含まれ、既存の出力とサマリーが引き続き正しい状態であれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 59
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug topic-attrs
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100