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
Bug Report
When calling
mypywith--show-column-numbers --show-error-endthe error end and column are reported.To Reproduce
Expected Behavior
Expected the output to contain column and error end numbers:
The same way it is e.g. if the type ignore is removed in the example:
Actual Behavior
No column or error end is included, only the line number:
Calling
mypywith only one of the flags results in the same behavior.Your Environment
mypy.ini(and other config files): no configuration