Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint not executed in multi-root workspace #4873

Closed
liwde opened this issue Mar 21, 2019 · 5 comments
Closed

pylint not executed in multi-root workspace #4873

liwde opened this issue Mar 21, 2019 · 5 comments
Labels
area-linting bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on regression Bug didn't exist in a previous release

Comments

@liwde
Copy link

liwde commented Mar 21, 2019

Environment 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:

  1. Open two empty folders in one workspace
  2. --see the notification that pylint is disabled--
  3. Click "Enable"
  4. --see that .vscode/settings.json is created in the first folder--
  5. Copy the created file to the second folder to have pylint explicitly activated there as well
  6. Optionally enable pep8 as a reference
  7. 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()
  1. Run linting on either of the files (e.g. through the explicit command)
  2. --notice pylint does not show up in the Output Panel, but pep8 does--
  3. 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 (ViewOutput, 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 (#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: #862

Please let me know if you need more information to reproduce this!
Thank you very much!

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Mar 21, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Mar 21, 2019
@DonJayamanne DonJayamanne self-assigned this Mar 21, 2019
@pzelnip
Copy link

pzelnip commented Mar 25, 2019

I'm not sure if it's the same issue that's affecting me, but almost every project I open now I get the "Pylint is installed but not enabled." message on startup even though it's enabled in my settings. Screenshot:

PylintNotEnabled

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release labels Mar 25, 2019
@DonJayamanne DonJayamanne removed their assignment Mar 25, 2019
@DonJayamanne DonJayamanne removed this from the 2019, week 14 - March Sprint 7 milestone Mar 27, 2019
@offero
Copy link

offero commented Sep 9, 2019

I am also seeing this behavior. The interpreter for each project in the workspace is set and pylint, flake8, pyflakes, etc are installed. It still does not lint in the editor.

@brettcannon
Copy link
Member

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).

@pzelnip
Copy link

pzelnip commented Jul 25, 2020

Thanks Brett!

@karrtikr karrtikr added the needs PR Ready to be worked on label Aug 9, 2022
@karthiknadig
Copy link
Member

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-linting bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

7 participants