Search code examples
pythonvisual-studio-codepylint

Can you disable Pylint inline messages in Visual Studio Code?


Is there a way to disable inline Pylint (v2023.10.1) messages in Visual Studio Code (version 1.84.2 on Windows 11)? For example, I'm referring to "Formatting a regular string which could be an f-string" in the image below.

Example Pylint inline message

I work with a lot of legacy code and I can't fix every message. I like the squiggly blue line and the list of problems. But I find the text to be very distracting when there are a lot of messages.


Solution

  • This is the Error Lens extension.

    The levels can be configured using:

    // settings.json
    {
      "errorLens.enabledDiagnosticLevels": [
        "error",
        "warning",
        "info"
      ]
    }
    

    These three are the default values. Remove one or some of them as you please.

    As an example, the following snippet triggers 3 types of notices:

    See answer source for transcription

    With "info" removed, it now looks like this:

    See answer source for transcription