运行 pylint 在最后导致错误

Running pylint causes errors at the end

每当我 运行 pylint 检查我的 python 脚本是否符合 PEP8 标准时,我都会在最后遇到错误。

所以,当我 运行

pylint script.py

它实际上生成了 pylint 结果,但最后还打印了以下错误:

Unable to create directory C:\Users\USER\AppData\Local\pylint\pylint\Cache
Unable to create file C:\Users\USER\AppData\Local\pylint\pylint\Cache\api1.stats: [Errno 2] No such file or directory: 'C:\Users\USER\AppData\Local\pylint\pylint\Cache\api1.stats'

这是一个问题,因为我正尝试从一个 makefile 中 运行 多个 pylint,但错误在第一个之后停止。

这是https://github.com/PyCQA/pylint/issues/4900的缘故,可以先自己创建缓存目录,或者等待pylint 2.11.0的主流修复