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

喜你入骨 提交于 2019-12-13 16:28:11

问题


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?


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/53597752/visual-studio-code-can-you-have-real-time-linting-for-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!