2

Related post

The above post asks how to disable linting in VS Code by Pylance. This proposed setting works:

"python.languageServer": "None"

But it also disables features like Intellisense and Go to Definition. I want to keep those features working and disable the automatic linting done by Pylance as I'm actively writing out code. It's very distracting.

Note that setting "python.linting.enabled": false doesn't work; Pylance still points out "problems" in code the moment I stop typing.

I also don't want to disable linting entirely, I just want to have more control over when my files are linted (like getting warnings after saving). I'm also using other programs like flake8 and bandit which provide the functionality I need and can be shut off until I'm ready to check my code.

Update:

I found a way to disable specific Pylance warnings by referencing this document in pylance-release. Setting a rule to none disables warnings for that rule. I added the following to my settings.json:

   "python.analysis.diagnosticSeverityOverrides": {
        "reportUnboundVariable": "none",
        "reportUndefinedVariable": "none",
        "reportMissingImports": "none",
        "reportMissingModuleSource": "none",
    }

I did not however find a way to disable syntax error warnings.

rioV8
  • 24,506
  • 3
  • 32
  • 49
mjohnson777
  • 51
  • 1
  • 1
  • 4

1 Answers1

-1

Open the command palette using Ctrl + Shift + P and type in linting. You should have 2 options1 It's pretty self explanatory from here.

Jules
  • 346
  • 1
  • 3
  • 15
  • 1
    That does work for other linting programs (flake8 for example), but as I explained in my post disabling linting does not disable linting by Pylance. – mjohnson777 Feb 04 '22 at 17:33