Created
July 19, 2012 06:58
-
-
Save javiermon/3141225 to your computer and use it in GitHub Desktop.
epylint for emacs 22. Save as epylint in PATH (no extension) to make flymake + pylint work under emacs 22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import sys | |
from subprocess import * | |
p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" % | |
sys.argv[1], shell = True, stdout = PIPE).stdout | |
for line in p: | |
match = re.search("\\[([WE])(, (.+?))?\\]", line) | |
if match: | |
kind = match.group(1) | |
func = match.group(3) | |
if kind == "W": | |
msg = "Warning" | |
else: | |
msg = "Error" | |
if func: | |
line = re.sub("\\[([WE])(, (.+?))?\\]", | |
"%s (%s):" % (msg, func), line) | |
else: | |
line = re.sub("\\[([WE])?\\]", "%s:" % msg, line) | |
print line, | |
p.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment