question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mypy output not correctly parsed with `--show-column-numbers`

See original GitHub issue

Environment data

  • VS Code version: 1.24.1
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: 10.13.5
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.4 (homebrew)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: mypy 0.610

Actual behavior

When the --show-column-numbers flag is used with python.linting.mypyArgs, the output is no longer parsed correctly. No Problems appear and no editor underlining occurs.

mypy output is still output to the Output tab.

Expected behavior

Mypy lint output parser should be agnostic to the --show-column-numbers flag.

Steps to reproduce:

  1. Have mypy installed and in $PATH

  2. Create a file with an incorrect types:

    # foo.py
    def foo(bar: int):
        pass
    
    
    foo("bar")
    
  3. Save and notice that mypy output correctly shows Problem and editor error indicator. image

  4. Update python.linting.mypyArgs to (i.e. add --show-column-numbers flag):

      "python.linting.mypyArgs": [
        "--ignore-missing-imports",
        "--follow-imports=silent",
        "--show-column-numbers"
      ],
    
  5. Notice that Problem and error indicator no longer appear, but output is still run but now contains column number. image

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

##########Linting Output - flake8##########
##########Linting Output - mypy##########
test.py:5:1: error: Argument 1 to "foo" has incompatible type "str"; expected "int"

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

N/A

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brettcannoncommented, Jul 11, 2018

@sudowork OK, then I’m going to leave this open as an enhancement that we would happily take a contribution for but that we aren’t going to prioritize right now.

0reactions
brettcannoncommented, Sep 20, 2018

To help manage our issues and to better communicate what the team plans to work on we are closing issues that we don’t plan to work on but would accept a pull request from a volunteer for. To be clear, closing this issue does not mean we won’t consider a pull request for this enhancement as outlined in our contributing guide, just that the development team has no plans to work on it themselves.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mypy output not correctly parsed with `--show-column-numbers`
When the --show-column-numbers flag is used with python.linting.mypyArgs , the output is no longer parsed correctly. No Problems appear and no ...
Read more >
Common issues and solutions - mypy 0.991 documentation
There are several common reasons why obviously wrong code is not flagged as an error. The function containing the error is not annotated....
Read more >
Mypy Documentation - Read the Docs
Mypy is a static type checker for Python. Type checkers help ensure that you're using variables and functions in your code correctly.
Read more >
The Comprehensive Guide to mypy - Tushar's Blog
A single article to teach you everything you need to know about Python's type checker.
Read more >
2016 - The Mypy Blog
No linear ordering of modules would produce clean output, ... New flag --show-column-numbers causes error messages to include column numbers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found