我想出了如何运行 pylint
在 VSCode 中保存我的文件时,但我不喜欢我被迫在 pylint
之间做出决定的事实和 mypy
当我想要两者时。有没有办法可以强制 VSCode 合并来自 pylint
的警告?和类型检查器?
最佳答案
这是一个对我有用的设置:
{
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintUseMinimalCheckers": false,
"python.linting.flake8Enabled": true,
"python.linting.mypyArgs": [
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers",
"--strict"
],
"python.pythonPath": "/home/d33tah/virtualenv/bin/python"
}
看起来我必须明确启用两个 linter 并添加
--strict
以便它按照我想要的方式工作。
关于visual-studio-code - 每次保存时自动运行 mypy 和 pylint?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57220416/