Pylint白名单模式

Pylint whitelist mode

我的团队正在考虑将 pylint 纳入我们的开发流程。根据我的经验,linters 适用于非常基本的检查,但最终会产生大量误报,而且可能比帮助更烦人。因此,我想 运行 白名单模式下的 pylint,默认情况下所有警告都是禁用的,我们会随着时间的推移逐渐添加我们感兴趣的警告。我做了一些谷歌搜索,没有看到明显的方法来做到这一点。有没有办法通过 .pylintrc 手动禁用所有内容?

来自pylint docs

If you want to enable only some checkers or some message symbols, first use --disable=all then --enable=<symbol> with being a comma separated list of checker names and message symbols. See the list of available features for a description of provided checkers with their functionalities.

禁用所有检查,然后明确启用所需的检查。例如:

pylint --score=no --disable=all --enable=unused-argument whatever.py