pylint not executed in multi-root workspace
See original GitHub issueEnvironment data
- VS Code version: 1.32.3
- Extension version (available under the Extensions sidebar): 2019.2.5558
- OS and version: Windows_NT x64 10.0.16299
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.2
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: pylint 2.1.1
Expected behaviour
When running the linters with pylint enabled, pylint should be executed and results should be shown. In the Output tab under Python, the linting output should be shown.
This is what happens when the folder is opened outside the multi-root workspace. Note that pep8 is also configured and shown in the log:
##########Linting Output - pep8##########
4,15,E,E225:missing whitespace around operator
##########Linting Output - pylint##########
************* Module test
test.py:4:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
test.py:4:12: C0326: Exactly one space required after comparison
if(__name__ =='__main__'):
^^ (bad-whitespace)
test.py:1:0: C0111: Missing module docstring (missing-docstring)
test.py:1:0: C0111: Missing function docstring (missing-docstring)
Actual behaviour
Pylint is not executed. Only pep8 is in the output:
##########Linting Output - pep8##########
4,15,E,E225:missing whitespace around operator
Additionally, a notification is shown: Linter pylint is installed but not enabled.
. However, pylint is enabled in the folder’s (not the workspaces) settings.json
Steps to reproduce:
- Open two empty folders in one workspace
- –see the notification that pylint is disabled–
- Click “Enable”
- –see that
.vscode/settings.json
is created in the first folder– - Copy the created file to the second folder to have pylint explicitly activated there as well
- Optionally enable pep8 as a reference
- Create a python file in both folders that have some errors. The following should be enough to trigger both pylint and pep8:
def main():
pass
if(__name__ =='__main__'):
main()
- Run linting on either of the files (e.g. through the explicit command)
- –notice pylint does not show up in the Output Panel, but pep8 does–
- Open either of the folders in its own window and see in the Output that pylint is executed
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
see above
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
[Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\Users\liwde\dev\one\test.py
Other
I noticed there recently was some work on tests in multi-root workspaces (https://github.com/Microsoft/vscode-python/issues/4268). I don’t know if there is any connection, but as I experienced this issue in the same project as well, I thought it might be worth mentioning here. Also maybe relevant here: https://github.com/Microsoft/vscode-python/issues/862
Please let me know if you need more information to reproduce this! Thank you very much!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top GitHub Comments
We are going through old issues and we noticed that no one from the team had replied to this issue. I want to apologize for the oversight and to let you know that the issue was reviewed by the team and triaged (as shown by the labels applied to this issue).
Please try the https://marketplace.visualstudio.com/items?itemName=ms-python.pylint extension. It should support multi-root, and multi-python scenarios. We are migrating users to the new extension. Closing this issue, since this should be handled by the new extension.