0

I am trying to get pylint with vscode to respect .pylintrc placed in a repository. I had a look into the documentation of both pylint and vscode python extension. It doesn't seem possible.

Folder structure:

Workspace-Root
    - Repository A
        - .pylintrc
        - src
            PYTHON SRC FILES
    - Repository B
        - .pylintrc
        - src
            PYTHON SRC FILES

We have currently +30 repositories from different teams. Is it somehow possible to configure the extension so that it will recognize the .pylintrc from the different projects without changing the workspace root to the repository folders? I want the linter to use the file under the folder repo folder from where the .py file is opened.

Daniel Bişar
  • 2,663
  • 7
  • 32
  • 54

1 Answers1

1

You can specify a configuration file through rcfile option in the settings.json like this:

"python.linting.pylintArgs": ["--rcfile=Repository A/.pylintrc"],

Or you can switch the linting cwd in the settings.json file like this:

"python.linting.cwd": "c:\\Work\\python3.10\\Repository A",
Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13
  • Good one, but this would have to be done manually by each developer each time he works on another repo. I guess it is not possible to somehow make vscode do the 'switch' automatically? Like some variable or something that could be used? – Daniel Bişar Mar 31 '22 at 07:24