为什么 vscode pylint 会漏掉明显的错误? [英] Why does vscode pylint miss obvious errors?

查看:64
本文介绍了为什么 vscode pylint 会漏掉明显的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio Code 中打开了一个 python 文件,但出现明显错误(使用未定义的变量),但问题"下列出的 pylint 问题仅显示了一长串次要约定问题.

I have a python file open in Visual Studio Code with an obvious error (using an undefined variable) but the pylint issues listed under 'Problems' show only a long list of minor convention issues.

在其上手动运行 pylint(与 vscode 分开)可以很好地发现错误.据我所知,任何与 vscode pylint 相关的配置都没有明确排除该错误.

Running pylint manually on it (separately from vscode) spots the error fine. The error is not explicitly excluded by any vscode pylint-related configs as far as I can see.

推荐答案

最终我发现这是由于 vscode 中的以下默认设置:

Eventually I discovered this was due to the following default setting in vscode:

"python.linting.maxNumberOfProblems": 100

将此配置编辑为更高的数字(例如 1000)会使错误显示出来.

Editing this config to a higher number (e.g. 1000) made the error show up.

显然,这个限制是按照发现问题的顺序盲目地应用于 pylint 输出,所以如果在错误之前有足够多的小问题,那么错误将被隐藏 - 不理想.

Evidently this limit is applied blindly to the pylint output in the order the problems are found, so if enough minor issues precede an error then the error will be hidden - not ideal.

这篇关于为什么 vscode pylint 会漏掉明显的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆