Noctsol
Noctsol

Reputation: 498

Visual Studio Code - Can you have real-time linting for python?

There is the same exact question here, but there hasn't been any replies.

Real-time linting of Python with VSCode

I'm using the Python extension right now that is on the VS code marketplace.

After about an hour of research, I found the following option in the linter:

python.linting.lintOnSave

I set it to false, but that just pretty much just disables linting. There has to be a way if auto complete works in real-time.

Is it possible to have linting done in real-time in VS code? As of right now, the linting only works when I save. Am I missing something?

Upvotes: 10

Views: 7978

Answers (2)

Brett Cannon
Brett Cannon

Reputation: 15990

It depends on what you are after from linting. If you want a specific linter to run constantly then the answer provided by @benni94 is accurate. But if you're simply after things like syntax errors then using the langauge server will provide this (set "python.jediEnabled": false in your settings to turn it on).

Upvotes: 1

Habebit
Habebit

Reputation: 975

Please a have look at this post. There was already a feature called lintOnTextChange, but it is deprecated now. You have to extend your config file with the following lines to get it work on text change:

"python.linting.lintOnSave": true,
"files.autoSave": true

But this is more a workaround, instead of a proper solution for your problem. Also have a look at this.

Upvotes: 6

Related Questions