Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`mypy` does not report column and error end for `ignore-without-code`

オープン
#21,856 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
tooling

調査の方向性

示されている main.py の例と mypy --show-column-numbers --show-error-end コマンドを使って報告を再現し、その後、ignore-without-code 診断がどのようにフォーマットされるかを追跡します。診断に期待される列と error-end の値が含まれ、既存の出力とサマリーが引き続き正しい状態であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug topic-error-reporting

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

python/mypy のほかの issue

python/mypy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。