Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set a path to setup.cfg in vs-code for its python plugin?

I have a development directory in which a python package is kept as a sub-directory. The package itself does not ship a setup.cfg, however, I like to have some development related settings which I do not want to push to the package, therefore I keep a setup.cfg file in the development directory.

E.g.

|- devdir/  # remote container -> /workspaces/devdir
   |- .devcontainer/
   |- setup.cfg
   |- package/
      |- package/
         |- __init__.py
         |- ...

My goal is to use the remote development within a docker container available for VS-Code.

Problem

VS-Code however, does not see the setup.cfg file and keeps showing errors for linters etc which would generally be handled by settings within setup.cfg.

Question

Is there a way to tell VS-Code where to look for the setup.cfg and provide that information to the python and remote plugins?

like image 837
E.Eisbrenner Avatar asked Aug 12 '26 10:08

E.Eisbrenner


1 Answers

Add the entry python.linting.pylintArgs: ["--rcfile=setup.cfg"] to your .vscode/settings.json file in your project folder.

like image 96
Nandeesh Avatar answered Aug 14 '26 10:08

Nandeesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!