-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add "--no-pretty" as default argument to mypy #17564
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
Conversation
| "--ignore-missing-imports", | ||
| "--show-column-numbers" | ||
| "--show-column-numbers", | ||
| "--no-pretty" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For similar reasons it would probably be nice to add --no-error-summary and maybe --hide-error-context as well.
|
@lithammer Thanks for the PR. Can you create a bug for this issue? and add a news item based on that issue number. Create a file For adding |
|
Thanks for reviewing. I had a look at existing issues and it would seem that adding Should I create a news item for that as well? Or should I perhaps just re-use that issue instead of creating my own? |
|
Yes you can use #16836 as the news file. |
6a6ba6c to
c994cab
Compare
This fixes an issue when the error text gets truncated because of
project local settings. As you can see from the example below, the
output with `--pretty` is wrapped (at 80 chars?) when piped.
The wrapped lines are truncated from the error message.
```console
$ cat > pyproject.toml <<<EOF
[tool.mypy]
pretty = true
EOF
$ cat > foobar.py <<<
def foobar(a: int):
pass
foobar("123")
EOF
$ mypy foobar.py
foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int"
foobar("123")
^
Found 1 error in 1 file (checked 1 source file)
$ mypy foobar.py | cat
foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str";
expected "int"
foobar("123")
^
Found 1 error in 1 file (checked 1 source file)
$ mypy --no-pretty foobar.py
foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int"
Found 1 error in 1 file (checked 1 source file)
$ mypy --no-pretty foobar.py | cat
foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int"
Found 1 error in 1 file (checked 1 source file)
```
c994cab to
713f080
Compare
Done! |
Not sure what the deal is with this failing check... 🤷♂️ Tried to rebase, but no bueno. |
|
That is just a check to ensure we have not missed any package update in package lock. Cleared it with "skip package*.json" |
|
Anything more you need me to do? |
|
@lithammer nothing for now. We are doing some repo maintenance, we will merge this soon. |
…python#17564) This fixes an issue when the error text gets truncated because of project local settings. As you can see from the example below, the output with `--pretty` is wrapped (at 80 chars?) when piped. The wrapped lines are truncated from the error message. ```console $ cat > pyproject.toml <<<EOF [tool.mypy] pretty = true EOF $ cat > foobar.py <<< def foobar(a: int): pass foobar("123") EOF $ mypy foobar.py foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int" foobar("123") ^ Found 1 error in 1 file (checked 1 source file) $ mypy foobar.py | cat foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int" foobar("123") ^ Found 1 error in 1 file (checked 1 source file) $ mypy --no-pretty foobar.py foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int" Found 1 error in 1 file (checked 1 source file) $ mypy --no-pretty foobar.py | cat foobar.py:5: error: Argument 1 to "foobar" has incompatible type "str"; expected "int" Found 1 error in 1 file (checked 1 source file) ```
This fixes an issue when the error text gets truncated because of project local settings. As you can see from the example below, the output with
--prettyis wrapped (at 80 chars?) when piped.The wrapped lines are truncated from the error message.
Without
--no-pretty:With
--no-pretty:Fixes #16836