Pylint未按预期在VScode中运行 [英] Pylint not running as expected in VScode

查看:375
本文介绍了Pylint未按预期在VScode中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过外壳运行时,pylint:

When I am running via shell a pylint:

$ pylint decorator.py 
No config file found, using default configuration
************* Module decorator
C:  7, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C: 15, 0: Unnecessary parens after 'print' keyword (superfluous-parens)
C:  1, 0: Missing module docstring (missing-docstring)
C:  4, 0: Missing function docstring (missing-docstring)
C:  6, 4: Missing function docstring (missing-docstring)
C: 14, 0: Missing function docstring (missing-docstring)

但是,如下所示,这些警告不会出现在VSCode中

However, as it can be seen below, these warning do not come up in VSCode

...尽管确实进行了一些基本检查,如下图所示,但我删除了空白行:

... despite the fact that some basic checking is indeed performed as it shown in the next picture where I have removed a blank line:

推荐答案

假设您已经正确配置了Python的扩展程序并安装了Pylint,

Assuming you have configured Python's Extension correctly and you have Pylint installed,

VSCode的Python扩展将默认情况下进行最小检查您没有提供Pylint配置选项.

VSCode's Python Extension will do minimal checking by default if you do not provide a Pylint configuration option.

只需在.vscode/settings.json中输入"python.linting.pylintUseMinimalCheckers": false,即可将其强制关闭.

Simply enter "python.linting.pylintUseMinimalCheckers": false, into your .vscode/settings.json to force this off.

这是我的样子:

{
    "autoDocstring.docstringFormat": "numpy",
    "editor.minimap.enabled": false,
    "editor.selectionClipboard": false,
    "python.pythonPath": "/home/jim/anaconda3/envs/dipoleDisplay",
    "window.zoomLevel": 0,
    "terminal.integrated.rendererType": "dom",
    "python.linting.pylintUseMinimalCheckers": false,
}

这篇关于Pylint未按预期在VScode中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆