Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically run both mypy AND pylint at every save?

I figured out how to run pylint when saving my file in VSCode, but I don't like the fact that I'm forced to decide between pylint and mypy when I want both. Is there a way I can force VSCode to combine warnings from pylint and a type checker?

like image 317
d33tah Avatar asked Jul 26 '19 12:07

d33tah


1 Answers

Here's a setup that worked for me:

{
    "python.linting.enabled": true,
    "python.linting.mypyEnabled": true,
    "python.linting.pylintEnabled": true,
    "python.linting.pylintUseMinimalCheckers": false,
    "python.linting.flake8Enabled": true,
    "python.linting.mypyArgs": [
        "--ignore-missing-imports",
        "--follow-imports=silent",
        "--show-column-numbers",
        "--strict"
    ],
    "python.pythonPath": "/home/d33tah/virtualenv/bin/python"
}

It looks like I had to explicitly enable both linters and add --strict so that it works the way I want it to.

like image 53
d33tah Avatar answered Oct 05 '22 07:10

d33tah