我一直在使用 flake8 进行 linting,但不知何故它不再向我显示任何工作区中代码中的错误(编辑器中的波浪下划线)。
flake8
安装在我的conda环境中。
这是我的
settings.json
:
{
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=80",
"--docstring-convention=google",
"--verbose"
]
}
当我从控制台运行
flake8
时,它确实显示了错误。
我在 Windows 上使用 VS Code 版本 1.72.2,并且安装了 flake8 版本 5.0.4。知道它可能出了什么问题吗?
打开命令面板并输入
Linter
。选择选项 Python: Select Linter
,它将打开所有可用的 linter。
在下拉列表中,选择 Flake8
,如果需要,请安装它。
现在应该可以了!
只需添加到
settings.json
:
"python.linting.flake8Path": "full_path_to_env/bin/flake8"