`mypy` does not report column and error end for `ignore-without-code`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Riproduci il report con l’esempio main.py mostrato e il comando mypy --show-column-numbers --show-error-end, quindi traccia il modo in cui viene formattata la diagnostica ignore-without-code. Il lavoro è completato quando la diagnostica include i valori previsti di colonna ed error-end, mentre l’output e il riepilogo esistenti rimangono corretti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Merge medio
- 1g 12h
- PR unite (30g)
- 58
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di python/mypy
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug topic-configuration topic-error-reporting
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug topic-attrs
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·