PyCharm和外部工具的过滤器 [英] PyCharm and filters for external tools

查看:468
本文介绍了PyCharm和外部工具的过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试PyCharm进行Django开发,到目前为止我非常高兴。我的团队严格遵循PEP8格式,我们使用pep8命令行程序检查以确保我们的代码符合。

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.

我已配置外部工具命令来运行pep8和它运作良好。我看到了创建过滤器的能力,这些过滤器会将输出解析为PyCharm可以使用的东西。我已经阅读了文档并搜索了Google,但无法找到一个示例来完成这项工作。文档是 http://www.jetbrains.com/pycharm/webhelp/add -filter-dialog.html

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

我正在使用PyCharm 1.2,我正在使用的输出过滤器如下所示:

I'm using PyCharm 1.2 and the output filter I'm using looks like this:

$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)

如果每次保存文件都可以运行,那么更棒的是什么。

What would be even more awesome is if this could be run each time the file is saved.

推荐答案

当你听到这个时,你会踢自己。你错过了COLUMN结束时的$。顺便说一句,非常感谢你,我按照你的步骤,让它完美地工作。你的过滤器应该是。

You're going to kick yourself when you hear this. You've missed a $ off the end of COLUMN. Thank you very much for this by the way, I followed your steps and I have it working perfectly. Your filter should be.

$FILE_PATH$:$LINE$:$COLUMN$:.*

UPD:要让它适用于PyCharm 1.5,请使用

UPD: To have it work for PyCharm 1.5 use

$FILE_PATH$\:$LINE$\:$COLUMN$\:.*

这篇关于PyCharm和外部工具的过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆