pylint在tox运行时会出现错误,但在其他情况下不会



我一直在为一个简单的项目添加pylint和tox:https://github.com/rrthomas/rpl/tree/tox

当我在代码上运行pylint时,关闭了一些警告,我没有得到任何错误:

$ pylint --disable=C,fixme,too-many-locals,too-many-branches,too-many-statements rpl
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.68/10, +0.32)

然而,当我用tox运行相同的pyint命令时,它会给我错误:

$ tox -e py310
...
py310 run-test: commands[2] | pylint --disable=C,fixme,too-many-locals,too-many-branches,too-many-statements rpl
************* Module rpl
rpl:356:11: E1101: Module 'regex' has no 'MULTILINE' member (no-member)
rpl:356:30: E1101: Module 'regex' has no 'IGNORECASE' member (no-member)
------------------------------------------------------------------
Your code has been rated at 9.68/10 (previous run: 9.68/10, +0.00)

我用的是相同版本的派林,有没有毒。

我很困惑,我不知道我是否做错了什么,或者是否有问题,在这种情况下,是谁的错?

tox在隔离状态下运行测试。我猜tox没有移动pylint配置文件,所以pylint不会再自动检测到pylint的配置。请尝试使用--rcfile选项来指定配置文件。

--verbose标志添加到由tox运行的pylint命令中。然后它告诉您在执行过程中实际使用的是哪个配置文件。结果往往出人意料。

我在这里写了更多关于背景的内容(尽管背景有所不同(。

相关内容

最新更新