rendered paste bodyfunc PyLint()
cgetexpr system("~/util/epylint " . bufname('%'))
endfunc
" map <c-w><c-e> :cgetexpr system("find . -type 'f' -name 'bufname('%')' -exec ~/util/epylint {} +")<cr>
map <c-w><c-e> :call PyLint()<cr>
map <c-w><c-r> :%s/[ \t]\+$//c<cr>
----------------------------------------------------
#!/usr/bin/env python
import re
import sys
from subprocess import *
null = open('/dev/null', 'w')
p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" % sys.argv[1], shell = True, stdout = PIPE, stderr = null).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()