我已经安装了 PyLint PyCharm 插件 ( https://plugins.jetbrains.com/plugin/11084-pylint )。如果我选择默认项目解释器安装在我的 Windows 笔记本电脑上,但我的项目解释器是我附加的 Docker 镜像上的解释器,我就可以让 linting 工作。当程序默认解释器是 Docker 镜像上的解释器时,PyLint 插件会提示:
The project interpreter is missing Pylint, which is needed to properly check the imports.
我已经在 docker 镜像上安装了 pylint,但是在文件 -> 设置 -> 项目解释器中查看时它没有显示包列表
有谁知道 PyLint 插件是否适用于此工作流程?
最佳答案
为了在 Docker 容器中运行 Pylint,我将其配置为外部工具。
程序:
docker-compose
参数:
run --rm django pylint --msg-template="$ProjectFileDir$/{path}:{line}:{column}: {msg_id}: {msg} ({symbol})" $FilePathRelativeToProjectRoot$
msg-template参数使每个文件路径都可单击,以便您可以轻松导航到有问题的行。
关于docker - PyCharm:从 docker 镜像运行 Pylint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55277714/