3

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.

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.