Skip to content
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

Mypy error message is truncated #73

Open
2 tasks done
lester-wu opened this issue Apr 15, 2021 · 4 comments
Open
2 tasks done

Mypy error message is truncated #73

lester-wu opened this issue Apr 15, 2021 · 4 comments

Comments

@lester-wu
Copy link

lester-wu commented Apr 15, 2021

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.11.2
  • PyCharm/IDEA version: 2021.1 community
  • Mypy version: 0.812

Step 3: Describe the problem:

Steps to reproduce:

Run Check Current File to run mypy on current mypy

Observed Results:

Screen Shot 2021-04-15 at 11 22 56 PM

Expected Results:

The error message is truncated so that I can not see the entire error message.
Fox example, the complete message for the first error would be Incompatible default for argument "arg1" (default has type "int", argument has type "str") [assignment], not Incompatible default for argument "arg1"

Relevant Code:

def test(arg1: str = 1, arg2: int = "2") -> None:
    return
@datalogics-kam
Copy link

datalogics-kam commented Aug 15, 2023

image

Should be

cdk_workshop/cdk_workshop_stack.py:13: error: Argument "runtime" to "Function" has incompatible type "int"; expected "Runtime"  [arg-type]
                runtime=3,
                        ^

PyCharm 2023.2.1 RC
Build #PY-232.9559.11, built on August 10, 2023

@intgr
Copy link
Collaborator

intgr commented Aug 16, 2023

I believe this happens when using the pretty = true setting in mypy configuration, which turns on word wrapping: https://mypy.readthedocs.io/en/stable/config_file.html#confval-pretty

There is an undocumented command line argument --no-pretty that the plugin could use.

Meanwhile as a workaround, remove pretty from your mypy settings.

@datalogics-kam
Copy link

as a workaround, remove pretty from your mypy settings.

That fixed it! Thanks for getting back to me with that information! I'm good for now.

There is an undocumented command line argument --no-pretty that the plugin could use.

That would be splendid, and it is in fact documented, from mypy --help

  --pretty                  Use visually nicer output in error messages: Use
                            soft word wrap, show source code snippets, and
                            show error location markers (inverse: --no-pretty)

@intgr
Copy link
Collaborator

intgr commented Aug 17, 2023

it is in fact documented

Ah nice! I only checked the online docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants