modern-stone-88910
07/06/2022, 7:58 AMPython: Run Linting
from the Command Palette works, or Format Document
when right-clicking in the workspace.
I’ve kind of got this working by adding following lines into the devcontainer.json -> "settings" after exporting the virtualenv with those tools through pants export:
"python.defaultInterpreterPath": "./dist/export/python/virtualenvs/default/3.8.13/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.blackEnabled": true,
"python.formatting.provider": "black",
"python.linting.pylintPath": "./dist/export/python/virtualenvs/tools/pylint/bin/pylint",
"python.linting.mypyPath": "./dist/export/python/virtualenvs/tools/mypy/bin/mypy",
"python.formatting.blackPath": "./dist/export/python/virtualenvs/tools/black/bin/black",
From previous experimenting with pants I know I got this working without having to define paths for each tool. Sadly, I forgot what I did then. What do I miss? Having to manually point each tool into one path seems prone to errors when using multiple environments. I need a way that VSCode gets a path to the virtualenvs-directory etc, so that the paths are automatically identified.
Thanks for your help.busy-vase-39202
07/12/2022, 4:31 PMhappy-kitchen-89482
07/12/2022, 5:47 PMmodern-stone-88910
07/13/2022, 7:52 AM