Created
April 13, 2011 07:26
-
-
Save andialbrecht/917126 to your computer and use it in GitHub Desktop.
Regex to parse pylint output
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
# Regex to extract error messages from "pylint -f parseable" output | |
import re | |
P_PYLINT_ERROR = re.compile(r""" | |
^(?P<file>.+?):(?P<line>[0-9]+):\ # file name and line number | |
\[(?P<type>[a-z])(?P<errno>\d+) # message type and error number, e.g. E0101 | |
(,\ (?P<hint>.+))?\]\ # optional class or function name | |
(?P<msg>.*) # finally, the error message | |
""", re.IGNORECASE|re.VERBOSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is what I used in go: