Skip to content

pylama [mypy] linter messages don't appear in the "Problems" tab #15609

Closed

Description

Environment data

  • VS Code version: 1.54.1
  • Extension version (available under the Extensions sidebar): v2021.2.582707922
  • OS and version: Linux x64 5.11.2-arch1-1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: pylama-7.7.1, mypy-0.800
  • Relevant/affected Python-related VS Code extensions and their versions: pylance-2021.3.0
  • Value of the python.languageServer setting: pylance-2021.3.0

Expected behaviour

See mypy issues reported by pylama in the "Problems" tab.

Actual behaviour

pylama's mypy output is visible in the "Output tab", but not in the "Problems" tab.

Steps to reproduce:

image

Activity

  1. added
    triage-needed
    bug
    on Mar 9, 2021
  2. ghost removed
    triage-needed
    on Mar 9, 2021
  3. karthiknadig commented on Mar 12, 2021

    @karthiknadig
    Member

    I am able to repro this, with following settings:

        "python.linting.pylamaEnabled": true,
        "python.linting.pylamaArgs": [
            "--linters",
            "mypy"
        ],
    
  4. nicolamarella commented on Jan 22, 2022

    @nicolamarella

    I am not 100% it's related, but in my case it doesn't work no matter what, even without mypy. I was able to trace down the problem to the default parser and started worked on a PR here #18339

    I will send an updated when I have successfully tested, will test mypy too.

    UPDATE:
    Althought I managed to fix the general output for me, for pylama, the mypy output has a slightly different output entry.
    For instance:

    # pylama/pycodestyle output line
    src/lib/test_py.py:23:60 [E] E226 missing whitespace around arithmetic operator [pycodestyle]
    
    # pylama/mypy output line
    src/test_py.py:7:4 [E]  Argument 1 to "fn" has incompatible type "str"; expected "int" [mypy]
    

    notice how the mypy output is missing the error code, something line E226. Now I could also add that to my PR, making it optional in the regex, but I am not 100% sure whether that's the right course of action. Might take a look at the pylama repo itself.

    Tested with

    def fn(a: int):
        pass
    
    
    unused_var = 123
    fn("1")

    image

    final note, this is my settings.json

    "python.linting.pylamaArgs": ["--linters=pycodestyle,pylint,mypy"],
  5. locked as resolved and limited conversation to collaborators on Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-lintingbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions