gpt4 book ai didi

docker - PyCharm:从 docker 镜像运行 Pylint

转载 作者:行者123 更新时间:2023-12-02 18:20:06 25 4
gpt4 key购买 nike

我已经安装了 PyLint PyCharm 插件 (https://plugins.jetbrains.com/plugin/11084-pylint)。如果我选择默认项目解释器作为安装在我的 Windows 笔记本电脑上的解释器,我可以让 linting 工作,但我的项目解释器是附加的 Docker 镜像上的解释器。当程序默认解释器是 Docker 镜像上的解释器时,PyLint 插件会提示:

The project interpreter is missing Pylint, which is needed to properly check the imports.



我已经在 docker 镜像上安装了 pylint,但是在查看 File -> Settings -> Project Interpreter 时它没有显示包列表

有谁知道 PyLint 插件是否适用于这个工作流程?

最佳答案

为了在 Docker 容器中运行 Pylint,我将其配置为外部工具。

Edit Tool window screenshot

程序:

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com