PyCharm 和外部工具过滤器
我正在尝试使用 PyCharm 进行 Django 开发,到目前为止我非常高兴。我的团队严格遵循 PEP8 格式,并使用 pep8 命令行程序进行检查以确保我们的代码符合要求。
我已经配置了一个外部工具命令来运行 pep8 并且运行良好。我看到了创建过滤器的功能,该过滤器将导致输出被解析为 PyCharm 可以使用的内容。我已阅读文档并搜索了 Google,但找不到实现此功能的示例。文档是 http://www.jetbrains.com/pycharm/webhelp/add -filter-dialog.html
我正在使用 PyCharm 1.2,我使用的输出过滤器如下所示:
$FILE_PATH$:$LINE$:$COLUMN:.*
示例输出如下所示:
/home/matt/.../settings.py:13:30: E261 at least two spaces before inline comment
/home/matt/.../settings.py:20:80: E501 line too long (126 characters)
如果每次文件都可以运行,那就更棒了已保存。
I'm trying out PyCharm for Django development and so far am extremely happy. My team strictly follows PEP8 formatting and we use the pep8 command line program to check to make sure our code conforms.
I've configured an external tool command to run pep8 and it works good. I see the capability to create filters that will cause the output to be parsed into something PyCharm can use. I've read the docs and searched Google but can't find an example to make this work. Docs are http://www.jetbrains.com/pycharm/webhelp/add-filter-dialog.html
I'm using PyCharm 1.2 and the output filter I'm using looks like this:
$FILE_PATH$:$LINE$:$COLUMN:.*
Example output looks like this:
/home/matt/.../settings.py:13:30: E261 at least two spaces before inline comment
/home/matt/.../settings.py:20:80: E501 line too long (126 characters)
What would be even more awesome is if this could be run each time the file is saved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您错过了 COLUMN 末尾的
$
。我按照你的步骤操作,效果非常好。您的过滤器应该是:更新:要使其适用于 PyCharm 1.5,请使用:
You've missed a
$
off the end of COLUMN. I followed your steps and I have it working perfectly. Your filter should be:Update: To have it work for PyCharm 1.5 use:
PyCharm 需要链接的完整文件路径,而不仅仅是名称。
PyCharm expects full file path for the links to work, not just the name.