Skip to content

Enable --pretty by default #19108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JukkaL opened this issue May 18, 2025 · 3 comments · May be fixed by #19122
Open

Enable --pretty by default #19108

JukkaL opened this issue May 18, 2025 · 3 comments · May be fixed by #19122

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented May 18, 2025

Feature

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.

@mkaraev
Copy link

mkaraev commented May 19, 2025

@JukkaL can I work on this issue?

@wyattscarpenter
Copy link
Contributor

@mkaraev There is no process in the mypy repo for requiring permission to work on an issue. Therefore: you can!

@mkaraev
Copy link

mkaraev commented May 19, 2025

Oh, okay. Great then :)

@mkaraev mkaraev linked a pull request May 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants