You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable --pretty by default. --no-pretty can still be used to get more concise error messages (it already works, so no need to implement it).
--pretty causes mypy to show the line with the error, and mypy will highlight the location on the line where the error was reported:
foo.py:13: error: List item 0 has incompatible type "str"; expected "int" [list-item]
aa = ["x"]
^~~
Also update documentation, including relevant command-line examples which show the error output from mypy.
Pitch
The additional context makes it easier to see what is wrong. For example, there may be multiple possible expressions which can generate the error, and the highlighting makes this obvious.
Activity
mkaraev commentedon May 19, 2025
@JukkaL can I work on this issue?
wyattscarpenter commentedon May 19, 2025
@mkaraev There is no process in the mypy repo for requiring permission to work on an issue. Therefore: you can!
mkaraev commentedon May 19, 2025
Oh, okay. Great then :)
feat: Enable --pretty by default.
fix(tests): Adapt CmdlineSuite to default to non-pretty output
fix(tests): Adapt pythoneval suite to default to non-pretty output
fix(tests): Adapt errorstream suite to default to non-pretty output
fix(tests): Adapt DaemonSuite to handle new pretty default
fix(tests): Adapt PEP561Suite to default to non-pretty output
fix(tests): Update Stubtest unit tests to expect pretty output
docs: Update docs for pretty-by-default behavior
feat: Enable --pretty by default.
fix(tests): Adapt CmdlineSuite to default to non-pretty output
fix(tests): Adapt pythoneval suite to default to non-pretty output
fix(tests): Adapt errorstream suite to default to non-pretty output
fix(tests): Adapt DaemonSuite to handle new pretty default
fix(tests): Adapt PEP561Suite to default to non-pretty output
fix(tests): Update Stubtest unit tests to expect pretty output
docs: Update docs for pretty-by-default behavior
Big-Marvel commentedon Sep 6, 2025
Is this issue resolved?
Enable --pretty by default
Enable --pretty by default for better error messages