2

Until around 3 weeks ago, I'd been using pylint for linting my python-files in VS Code.

Then, I enabled pylance replacing pylint. Yet, pylance is not listed in the specific linter-list provided by VS Code.

Now, pylance doesn't show me unused module imports. I suspect this is not included in the default linting arguments of pylance, so I tried to find out how to modify them akin to the procedure of doing so with pylint, such as documented here and implemented like so (inserted into the settings.json - file of the current workspace):

"python.linting.pylintArgs": [
    "--max-line-length=80",
    "--disable=W0142,W0403,W0613,W0232,R0903,R0913,C0103,R0914,C0304,F0401,W0402,E1101,W0614,C0111,C0301"
]

How can I customize in a similar fashion the linting rules of pylance?

Andreas L.
  • 3,239
  • 5
  • 26
  • 65

1 Answers1

5

The python.linting.pylintArgs setting is for pylint only and is not used by pylance (as far as I know)

It seems the setting you are looking for is this one python.analysis.diagnosticSeverityOverrides:

{
    "python.analysis.diagnosticSeverityOverrides": {
        "reportUnusedImport": "information"
    }
} 

For the list of pylance settings you can visit this page and this one.

hamzahik
  • 714
  • 4
  • 7
  • Thanks! In the last line, you probably meant pylance settings instead of pylint. Also, I'm aware that pylint-args can't be used for pylance, that's why I asked this question in the first place ;) – Andreas L. Dec 05 '20 at 16:26