pylint in vscode does not behave the same as command line
See original GitHub issueHello,
When running pylint within vscode, it does not behave the same as the command line version of pylint even though I have configured vscode to use the same settings file. Can you please help me understand why it differs and correct it?
Version Info
ms-python.python: v2020.8.108011
vscode:
Version: 1.49.0
Commit: e790b931385d72cf5669fcefc51cdf65990efa5d
Date: 2020-09-10T17:39:53.251Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.5.0
Python: 3.8.1
pylint: 2.6.0
Virtual environment: virtualenv
Settings
Here’s the relevant settings from my vscode settings.json
:
"python.pythonPath": "~/.pyenv/shims/python",
"python.linting.pycodestylePath": "~/.pyenv/shims/pycodestyle",
"python.linting.pylintPath": "~/.pyenv/shims/pylint",
"python.linting.pylintUseMinimalCheckers": false,
"python.linting.pylintArgs": [
"--rcfile=setup.cfg"
],
My python setup.cfg
is:
[pylint]
disable = W0703
max-line-length = 90
Results
When I run pylint from the command line, I get this:
$ pylint --rcfile=setup.cfg ssmpsm.py
************* Module ssmpsm
ssmpsm.py:131:0: C0301: Line too long (95/90) (line-too-long)
ssmpsm.py:163:0: C0301: Line too long (95/90) (line-too-long)
ssmpsm.py:181:0: C0301: Line too long (98/90) (line-too-long)
ssmpsm.py:152:4: R1703: The if statement can be replaced with 'var = bool(test)' (simplifiable-if-statement)
ssmpsm.py:147:0: R0912: Too many branches (14/12) (too-many-branches)
When pylint runs within vscode, it does not display R1703 and R0912 as per this screen shot:
If I change the max-line-length
in setup.cfg
, vscode does honour that setting in setup.cfg
.
Expected Behaviour
I would expect vscode to behave the same way as the command line in with my current configuration.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Do you have this setting checked or unchecked?:
We now have a new pylint extension (currently in pre-release) that provides greater control over some of the settings. It also runs in server mode so it should perform better in most scenarios. Please have a look https://marketplace.visualstudio.com/items?itemName=ms-python.pylint
With that extension you can control individual error codes if you need to like this: