mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
29 lines
629 B
Python
Executable File
29 lines
629 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import re
|
|
import sys
|
|
|
|
from popen2 import popen3
|
|
|
|
p, _in, _err = popen3("pylint -f parseable -r n --disable-msg-cat=C,R,I %s" % sys.argv[1])
|
|
|
|
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()
|