我想将Pylint配置为我正在处理的Python项目的整个项目目录中的一个外部工具.我曾try 将存储库作为一个有__init__.py
个和没有__init__.py
个的模块使用,但这两种方式都不起作用.
我很难设置Pylint与PyCharm一起运行.我知道我应该把它作为一个外部工具来运行,但是设置让我困惑.
他们文档的权威来源被 destruct 了,所以我也无法判断.
我想将Pylint配置为我正在处理的Python项目的整个项目目录中的一个外部工具.我曾try 将存储库作为一个有__init__.py
个和没有__init__.py
个的模块使用,但这两种方式都不起作用.
我很难设置Pylint与PyCharm一起运行.我知道我应该把它作为一个外部工具来运行,但是设置让我困惑.
他们文档的权威来源被 destruct 了,所以我也无法判断.
您可以通过以下步骤将Pylint设置为使用PyCharm:
安装pylint
:
$ pip install pylint
找到pylint
安装文件夹:
$ which pylint # MacOS/Linux
/usr/local/bin/pylint # This is just a possible output - check yours
<!-->
$ where pylint # Windows
%LocalAppData%\Programs\Python\Python36-32\Scripts\pylint.exe # Possible location
使用菜单File打开PyCharm设置窗口→ Settings,然后导航至菜单Tools→ External Tools在侧边栏.(或搜索"external tools")
通过点击+
号并相应地填写字段来设置外部工具.在Program中,使用运行which pylint
时得到的路径.对于其他值,可以使用图像中的相同值.
从菜单Tools运行pylint
→ External Tools→ pylint:
查看PyCharm终端中的输出
有关更多详细信息,请参阅Pylinting with PyCharm.
如果想使用Pylint判断整个项目或特定文件或目录,可以右键单击项目根、文件或目录,然后激活External Tools→ pylint如下图所示.