vscode-python: Pylint not working when language server is on
Environment data
- VS Code version: 1.38.0
- Extension version (available under the Extensions sidebar): 2019.9.34911
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions: pylint 2.3.1,
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): Language Server
Expected behaviour
Having linting, pylint and LS enabled in user settings should provide linting messages from both pylint and the LS.
Actual behaviour
Only LS is displaying linting messages. In order to get pylint to work, the workaround is to explicitly enable it in the workspace settings.
Steps to reproduce:
Enable pylint in the user settings, and make sure linting and the LS are enabled. Write a piece of code wrongly and notice that only the LS will display linting messages. We’d expect pylint to work as well.
cc @Anapo14
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 20 (7 by maintainers)
I am not sure what is meant by “this is how it has always worked”? As I understand it, the issue is that in the VSCode settings, the “Python > Linting: Pylint Enabled” checkbox is checked by default, but pylint is not actually enabled. So there is a discrepancy between what the Settings page shows and what the actual state of the settings is
Additionally, unchecking and re-checking the checkbox does not enable pylint (
python.linting.pylintEnabled
entry is deleted from settings.json when it is checked), so there is no way to enable pylint via the settings GUI. It seems the only way to enable it is to “manually” edit the settings.json file. I don’t think this is what the behavior was in previous versions?Verified fixed in main.
@luabud that code is what visual studio code is running when I run the lint command. I don’t see an error in the logs but I do see the command with no output. I’m not sure if the quotes are actually missing or if they were stripped because of weird log/shell stuff. I’ll probably open my own issue.
@darrickyee Same observations here. I reproduced your bug and the behaviour is same. Unless you declare your changes in .vscode > settings.json, checkbox is not registered by the extension.
E.g. - pylint is enabled in both user and workspace settings by default but I also have to declare
in settings.json to enable pylint.