简体   繁体   English

PyCharm中的Flake8链接不正确,不带你去源码

[英]Flake8 links in PyCharm are incorrect and do not take you to the source code

I have setup my PyCharm as described in Descriptive flake8 errors in PyCharm .我已经按照 PyCharm 中的描述性 flake8 错误中的描述设置了我的 PyCharm The argument line looks like the following.参数行如下所示。

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

When I run Flake8 in PyCharm, I get the nicely formated text as described.当我在 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'

However, when I click on the error to goto the spot on the code, the link is invalid.但是,当我单击错误以转到代码上的位置时,链接无效。 For example, the links for above looks like the following.例如,上面的链接如下所示。

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

If I run the above from the terminal from within PyCharm I get the following output and the links work.如果我从 PyCharm 中的终端运行上述内容,我会得到以下 output 并且链接有效。

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

Any idea on why this is happening?知道为什么会这样吗?

The issue was with the argument.问题在于论点。 The settings should be as follows.设置应如下所示。 Arguments: $FileName$ --format='%(path)s:%(row)d,%(col)d:%(code)s:%(text)s:https://lintlyci.github.io/Flake8Rules/rules/%(code)s.html' Arguments: $FileName$ --format='%(path)s:%(row)d,%(col)d:%(code)s:%(text)s:https://lintlyci.github.io/Flake8Rules/rules/%(code)s.html'

Working Directory: $ContentRoot$工作目录: $ContentRoot$

For correct output you have to run flake8 command from working directory (project root)对于正确的 output 您必须从工作目录(项目根目录)运行 flake8 命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM