10

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,
Neil Walker
  • 6,400
  • 14
  • 57
  • 86

2 Answers2

13

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

rdas
  • 20,604
  • 6
  • 33
  • 46
  • 1
    Thanks for your help. You made me look at the 'default' settings in VS Code and I found this entry amongst the hundreds there: 'pylint use minimal checkers'. This is checked by default. What this does when unchecked is adds: "python.linting.pylintUseMinimalCheckers": false Setting this makes it work with showing warnings. Do you think this is a more appropriate answer, or yours? – Neil Walker May 07 '19 at 13:13
  • If you define `pylintArgs` the `pylintUseMinimalCheckers` is implicitly set to `False` so it's up to you what you prefer. – rdas May 07 '19 at 13:14
  • Ok, I'll mark it as correct answer seeing as my comment is also here for anybody else happening to wonder. The original reason I asked is at home on my VSCode it does not do this, but the only difference is I installed Python 3.4 manually not via miniconda (python 3.7), so maybe these version or package differences has altered something? – Neil Walker May 07 '19 at 13:17
-3

i simply disabled pylint for python by going to,

file>preference>python>linting

and everything is working normal and totally fine.

Sadaf
  • 9
  • 3