Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pylint only showing errors in VSCode

If I have the following code:

print("hello")
a = 2
b =3
print "hello"

The only pylint message I get within VSCode or the command line is:

Missing parentheses in call to 'print'. Did you mean print("hello")? (, line 4) pylint(syntax-error) [4,1]

If I fix the error then I get no messages from pylint within VSCode, but from a command line I get all the warnings such as bad spacing, bad const variable name, etc. and only get the above error if I call pylint with -E.

I'm running python 3.7.0 installed via miniconda.

Two questions really: 1. Is there a way to get the warnings as well as the errors at the same time 2. How do I fix VSCode to stop showing only errors

Thanks for any help.

btw, this is my settings file entry for python:

"[python]": {},
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
like image 866
Neil Walker Avatar asked May 07 '19 12:05

Neil Walker


1 Answers

Seems that's the default behaviour for PyLint in VSCode. To fix it add

"python.linting.pylintArgs": ["--enable=F,E,W"]

This overrides the default (strict checks) and enables all fatal(F), error(E) & warning(W) messages. The vscode docs mention a lot of other ways to configure this behaviour: https://code.visualstudio.com/docs/python/linting#_default-pylint-rules

like image 170
rdas Avatar answered Oct 01 '22 02:10

rdas