VS Code 与 Pylint 有问题
VS Code has issues with Pylint
我的环境:Mac,Python3.9,venv.
这是我要检查的文件(编辑器未显示检查)。
import pandas as pd
df = pd.DataFrame()
fc = 1
运行 命令行中的 linter returns 预期:
我已经检查了各种 SO 条目并应用了以下建议的解决方案
在 vscode 我启用了 linting,选择 pylint 作为 linter 和 运行
我禁用了最小的跳棋。我的.vscode/settings.json:
{
"python.linting.pylintUseMinimalCheckers": false,
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.pythonPath": "venv/bin/python"
}
创建了 .pylintrc
和 pylint --generate-rcfile -encoding utf8 > ~/.pylintrc
知道如何解决这个问题吗?
我看到你在你的配置文件中禁用了 Minimal checkers
,但它对我有用 VScode GUI 支持所以让我们试一试:
Config - 当我使用 pylint 作为 Linter 并且 Minimal checkers
被禁用时:
结果 - 小写的全局变量正在生成消息。
注意:请确保您使用的是 Pylint 作为 linter(如附图中的第一张图片所示)。
根据您的描述,建议您查看以下两个文件:
请检查设置文件“settings.json
”是否包含"python.linting.pylintArgs": [],
相关设置。
除了你提供的“.vscode/settings.json
”外,还要注意查看全局设置“User/settings.json
”是否包含以上设置,如果有则关闭Pylint信息内容已设置。
例如:"python.linting.pylintArgs":[ "----extension-pkg-whitelist=1xml" ]
这里有关闭内容,所以会关闭Pylint信息。请注释掉此设置。
由于您创建了文件“.pylintrc
”,请检查该文件是否包含like
disable=
C0114, # missing-module-docstring
C0103, # invalid-name"
相关设置,会关闭特定的Pylint通知。
效果:
我的“.vscode/settings.json
”的内容和你的基本一样。以下是我的“User/settings.json
”的内容:
{
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe",
"workbench.iconTheme": "vscode-icons",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"python.linting.enabled": true,
"python.languageServer": "Microsoft",
}
我的环境:Mac,Python3.9,venv.
这是我要检查的文件(编辑器未显示检查)。
import pandas as pd
df = pd.DataFrame()
fc = 1
运行 命令行中的 linter returns 预期:
我已经检查了各种 SO 条目并应用了以下建议的解决方案
在 vscode 我启用了 linting,选择 pylint 作为 linter 和 运行
我禁用了最小的跳棋。我的.vscode/settings.json:
{ "python.linting.pylintUseMinimalCheckers": false, "python.linting.enabled": true, "python.linting.pylintEnabled": true, "python.pythonPath": "venv/bin/python" }
创建了
.pylintrc
和pylint --generate-rcfile -encoding utf8 > ~/.pylintrc
知道如何解决这个问题吗?
我看到你在你的配置文件中禁用了 Minimal checkers
,但它对我有用 VScode GUI 支持所以让我们试一试:
Config - 当我使用 pylint 作为 Linter 并且 Minimal checkers
被禁用时:
结果 - 小写的全局变量正在生成消息。
注意:请确保您使用的是 Pylint 作为 linter(如附图中的第一张图片所示)。
根据您的描述,建议您查看以下两个文件:
请检查设置文件“
settings.json
”是否包含"python.linting.pylintArgs": [],
相关设置。除了你提供的“
.vscode/settings.json
”外,还要注意查看全局设置“User/settings.json
”是否包含以上设置,如果有则关闭Pylint信息内容已设置。例如:
"python.linting.pylintArgs":[ "----extension-pkg-whitelist=1xml" ]
这里有关闭内容,所以会关闭Pylint信息。请注释掉此设置。由于您创建了文件“
.pylintrc
”,请检查该文件是否包含like
disable= C0114, # missing-module-docstring C0103, # invalid-name"
相关设置,会关闭特定的Pylint通知。
效果:
我的“.vscode/settings.json
”的内容和你的基本一样。以下是我的“User/settings.json
”的内容:
{
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe",
"workbench.iconTheme": "vscode-icons",
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000,
"python.linting.enabled": true,
"python.languageServer": "Microsoft",
}