PyCharm中的Flake8链接不正确,不能带你到源代码。

问题描述 投票:0回答:1

我已经按照下面的描述设置了我的PyCharm。PyCharm中的描述性flake8错误。. 参数行看起来像下面这样。

$FilePath$ --format='%(path)s:%(row)d,%(col)d:%(code)s:%(text)s:https://lintlyci.github.io/Flake8Rules/rules/%(code)s.html'

当我在PyCharm中运行Flake8时,我得到了如上所述的格式很好的文本。

'C:\Users\XYZ\PycharmProjects\TestProject\test.py:77,80:E501:line too long (106 > 79 characters):https://lintlyci.github.io/Flake8Rules/rules/E501.html'

然而,当我点击错误以进入代码中的位置时,链接是无效的。例如,上面的链接看起来像下面。

C:\Users\XYZ\PycharmProjects\TestProject\test.py:77,80:E501:line

如果我从PyCharm中的终端运行上面的代码,我得到以下输出,而且链接有效。

test.py:77,80:E501:line too long (106 > 79 characters):https://lintlyci.github.io/Flake8Rules/rules/E501.html

请问为什么会出现这种情况?

python pycharm flake8
1个回答
0
投票

问题出在参数上。设置应该如下.Arguments:$FileName$ --format='%(path)s:%(row)d,%(col)d:%(code)s:%(text)s:https://lintlyci.github.io/Flake8Rules/rules/%(code)s.html'

工作目录:$ContentRoot$

© www.soinside.com 2019 - 2024. All rights reserved.