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 "Linting Output" empty despite regular command reporting errors

See original GitHub issue

Environment data

  • VS Code version: 1.38.1
  • Extension version (available under the Extensions sidebar): 2019.9.3491.1
  • OS and version: Windows 10 Pro
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.7.3 or 3.6.9
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda (miniconda)
  • Relevant/affected Python packages and their versions: mypy 0.720
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): Jedi Enabled True

Expected behaviour

Output from the mypy command is displayed in the OUTPUT tab under the Python dropdown, and the contents is parsed to be shown in the Problems tab

Actual behaviour

OUTPUT tab shows the command being executed (twice actually), but the Linting Output - mypy is empty. Copy-pasting the exact mypy command shown in this tab to a command prompt prints some errors as expected.

Yesterday I thought I had solved the problem by completely uninstalling and reinstalling miniconda, creating the virtual env again, which solved the problem for a little while. Now the problem is back. Cannot get mypy to work with either the base miniconda env or my custom one.

Steps to reproduce:

  1. Create virtual environment with version python=3.6 or python=3.7 using miniconda3 on Windows
  2. Install mypy through pip install or conda install
  3. Select this environment from the status bar
  4. Open document with expected mypy errors
  5. Display OUTPUT tab and select Python from the dropdown list
  6. Observe the ##########Linting Output - mypy########## being empty

Logs

> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m black --line-length 120 --skip-string-normalization --diff --quiet c:\...\file.py.10dc09022f6774807dcf3aee42e24318.py
cwd: c:\...
> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m black --line-length 120 --skip-string-normalization --diff --quiet c:\...\file.py.10dc09022f6774807dcf3aee42e24318.py
cwd: c:\...
> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m flake8 --max-line-length=120 --exclude=__init__.py --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s c:\...\file.py
cwd: c:\...
> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m flake8 --max-line-length=120 --exclude=__init__.py --format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s c:\...\file.py
cwd: c:\...
> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m mypy --ignore-missing-imports c:\...\file.py
cwd: c:\...
> ~\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m mypy --ignore-missing-imports c:\...\file.py
cwd: c:\...
##########Linting Output - mypy##########
##########Linting Output - flake8##########
53,1,D,D102:Missing docstring in public method
200,1,D,D102:Missing docstring in public method
234,1,D,D102:Missing docstring in public method

This is what the same command outputs if I run it in a separate terminal

(smsl) C:\Users\...>C:\Users\...\AppData\Local\Continuum\miniconda3\envs\smsl\python.exe -m mypy --ignore-missing-imports file.py
file.py:18: error: Module 'utilities.generic_utilities' has no attribute 'Config'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:13

github_iconTop GitHub Comments

1reaction
iutlucommented, Nov 17, 2019

@kimadeline great to see this is being fixed! @beeb interesting – possibly I’m facing a different issue than the original 😕 @karrtikr I was also not using any nonstandard names (foo, bar in fact 😄)

1reaction
beebcommented, Nov 13, 2019

Thanks @karrtikr but it isn’t. I found that issue when I was looking up my problem but it was unrelated to filename, as I used very simple names when testing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common issues and solutions - mypy 0.991 documentation
Common issues and solutions# · Can't install mypy using pip# · No errors reported for obviously wrong code# · Spurious errors and locally...
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 >
Jeremy Fortune on Twitter: "@kimadeline_m I was able to reproduce ...
Mypy "Linting Output" empty despite regular command reporting errors · Issue #7595 · microsoft/vs... Environment data VS Code version: 1.38.1 Extension ...
Read more >
PEP 484 – Type Hints - Python Enhancement Proposals
This PEP introduces a provisional module to provide these standard definitions and tools, along with some conventions for situations where annotations are not ......
Read more >
Mypy not displaying errors when target file has absolute path
No form of mypy configuration file used anywhere (though I also performed the same tests with a project containing a config file that...
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