How to change the .pylintrc file that VS Code is using for linting?

Garry Mccarthy picture Garry Mccarthy · Jan 7, 2020 · Viewed 7.7k times · Source

We have a .pylintrc file committed to git in our project root that is used by our team which has many useful errors disabled. So VS Code doesn't show those. I want to know if I can use my own pylint rules only on my local machine without having to modify the team's .pylintrc file in git.

I know that pylint has an option called --rcfile which can be used to specify custom .pylintrc file. I think if I can specify this option in VS Code settings I can get it to show me more errors. Do you know how to do it?

Answer

Leo picture Leo · Oct 5, 2020

If you'd rather have the same .pylintrc enabled for all your environments, you can add to your settings.json the command-line pointer to the config:

    "python.linting.pylintArgs": [
        "--rcfile=${env:HOME}/path/to/your/.pylintrc"
    ]

To keep the same config on Windows and Linux I add HOME=%USERPROFILE% to my User Environment variables on Windows.