Created
March 8, 2019 15:59
-
-
Save lbolla/f81def50503998e6582368b59f98b03f to your computer and use it in GitHub Desktop.
Example for pycheckers bug report msherry/flycheck-pycheckers#33
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
import re | |
line = 'filename.py:24: error: Dict entry 0 has incompatible type "str": "str"; expected "int": "str"' | |
output_matcher = re.compile( | |
r'(?P<filename>[^:]+):' | |
r'(?P<line_number>[^:]+):' | |
r'((?P<column_number>[^:]+):)?' # Column number is optional, depending on mypy options | |
r' (?P<level>[^:]+):' | |
r' (?P<description>.+)$') | |
m = output_matcher.match(line) | |
print(m.groupdict()) | |
output_matcher = re.compile( | |
r'(?P<filename>[^:]+):' | |
r'(?P<line_number>\d+):' | |
r'((?P<column_number>\d+):)?' # Column number is optional, depending on mypy options | |
r' (?P<level>[^:]+):' | |
r' (?P<description>.+)$') | |
m = output_matcher.match(line) | |
print(m.groupdict()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment