PyCharm and filters for external tools

左心房为你撑大大i 提交于 2019-12-03 15:30:02

问题


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.


回答1:


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: To have it work for PyCharm 1.5 use

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



回答2:


PyCharm expects full file path for the links to work, not just the name.



来源:https://stackoverflow.com/questions/5436540/pycharm-and-filters-for-external-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!