Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there so many improper underlines when I debugging python code in Visual Studio Code

I have been writing my python code in VSCode with a python extension named 'python' on Ubuntu for many days. It has been very nice.

However, today I meet some problems as shown in the picture:

I have write the correct code which can be run properly (both for debugging and running through the Terminal). But there are many green underlines and a few red underlines which give many tips as:

for green underlines:

  • C0326:No space allowed before bracket (pylint)

  • W0621:Redefining name 'img' from outer scope (line 60) (pylint)

  • C0103:Invalid variable name "c" (pylint)

  • C0326:Exactly one space required after comma (pylint)

  • C0303:Trailing whitespace (pylint)

  • and so on

for red underlines:

E0602:Undefined variable 'Runtime' (pylint)

Unspecified run-time error.

It seems this occured since I pressed one shortcut key accidentally, but I don't know which key it is.

How can I get rid of these underlines?

like image 616
Kongsea Avatar asked Jun 08 '16 06:06

Kongsea


1 Answers

I'm the author of the extension. An updated was pushed out on the 9th of June. It is possible you hadn't updated for a while. To get rid of these messages you could either fix the corresponding errors or just turn off linting by going into the settings.json file and adding the following setting:

"python.linting.enabled":false
like image 146
Don Avatar answered Oct 10 '22 10:10

Don