我想从 mypy 检查中排除一个文件夹。查看文档我在 mypy.ini 配置文件中尝试了以下配置
[mypy]
python_version = 3.8
exclude '/venv/'
Run Code Online (Sandbox Code Playgroud)
没有运气。
我想从 mypy 检查中排除我的虚拟环境。我只有一个来检查我写的代码。
这是 mypy 的错误吗?
我正在使用 mypy 0.901 和 mypy-extensions 0.4.3。我还使用 mypy vs-code 扩展 0.2.0。
我想在 Visual Studio Code 上配置 Mypy 以在我的项目中强制执行类型提示。
我使用以下配置
"python.linting.pylintArgs": [
"--disable=W0611"
],
"python.linting.mypyEnabled":true,
"python.linting.mypyCategorySeverity.note":"Warning",
"python.linting.mypyArgs": [
"--ignore-missing-imports",
"--follow-imports=silent",
"--show-column-numbers",
"--disallow-untyped-defs=True",
"--disallow-untyped-calls=True",
"--check-untyped-defs=True",
"--no-implicit-optional=True",
]
Run Code Online (Sandbox Code Playgroud)
然而,我有一些没有类型注释的函数,我没有得到任何关于它们的信息、警告或错误。实际上 Mypy 似乎不起作用。当我删除“无隐式可选”选项时,它实际上只会捕获误报。
我缺少什么?