如果使用 python 自带的 lint
在 VSCode 中依次点击 File -> Preferences -> Settings ,然后在右上角点击 Open Setting(JSON),在打开的 json 文件中添加以下语句:
"python.linting.pylintArgs": ["--errors-only"],
如:
{
"workbench.colorTheme": "Default Dark+",
"git.autofetch": true,
"remote.SSH.remotePlatform": {
"10.79.1.230": "linux"
},
"[python]": {
"editor.wordBasedSuggestions": false
},
"python.linting.banditEnabled": true,
"python.linting.pylintArgs": ["--errors-only"],
}
配置 Linting: Bandit Enabled

image.png
如果是vscode Pylint 插件
在 settings.json 里添加
"pylint.args": ["--errors-only"],

image.png
{
"workbench.colorTheme": "Default Dark+",
"git.autofetch": true,
"remote.SSH.remotePlatform": {
"10.79.1.230": "linux"
},
"[python]": {
"editor.wordBasedSuggestions": false
},
"python.linting.banditEnabled": true,
"pylint.args": ["--errors-only"],
}