How to disable pylint warnings and messages on Visual Studio Code?
Asked Answered
S

2

20

I am using a Mac and programming with Python on VS Code. After installing pylint, I had a bunch of warnings and messages. How do I disable these? I know about adding some lines to the pylintrc file, but I don't know where to find it or how to create it on a Mac.

Sumptuous answered 9/9, 2020 at 9:48 Comment(2)
If you type (the title of) your question into google it gives you the answer in the first resultSanches
For a single file, just use # pylint: disable=allImpossible
S
28

Fully disable the linting

Here is a link that explain how to do it : Disable Linting on VsCode.

To do so, type Command + Shift + P (or Ctrl + Shift + P on PC) in VsCode. This will open a command prompt at the top of the window. Then type the command Python: Enable Linting, and select off.

Another option is to choose no linter. To do so, open the command prompt with Command + Shift + P (or Ctrl + Shift + P on PC), type Python: Select Linter, and choose the option Disable Linting.


Disable warnings, but keep errors :

If you want to keep the errors, but disable only the warnings, you can also configure pylint directly from VsCode. Go to the menu File -> Preferences -> Settings (Or open directly with Command + , or Ctrl + ,). Then in the search box at the top of the window, search for pylint Args. Click on the button Add item and add the line --disable=W.

enter image description here

Sunglasses answered 9/9, 2020 at 9:54 Comment(4)
To disable a specific warning/info, mention its exact name. For eg) --disable=bad-indentation or --disable=logging-fstring-interpolationSubcutaneous
Tested right now : doesn't work with Python 3.8.10 and Version: 1.73.1 (system setup) // Commit: 6261075646f055b99068d3688932416f2346dd3b // Date: 2022-11-09T04:27:29.066Z // Electron: 19.0.17 // Chromium: 102.0.5005.167 // Node.js: 16.14.2 // V8: 10.2.154.15-electron.0 // OS: Windows_NT x64 10.0.22621 // Sandboxed: NoKaliski
Pricise python version = Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]Kaliski
Entirely disabling linting surely would disable pylint, but it will disable other linters as well.Hoboken
F
8

I had disabled pylint in the settings but was still getting pylint linting showing up in my code, until I noticed there was a "pylint" vscode extension installed. Disabling that extension finally silenced pylint!

Forty answered 28/6, 2023 at 1:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.