The way that out lines are matched is not allowing for colons in the output message, because the severity group can capture up to the last colon in the message:
r"^(?P<fname>.*):(?P<lnum>\d*): (?P<severity>.*):((?P<col>\d+):)? (?P<message>.*)$"
Given a typical input with type annotations in a function:
main:2: note: Revealed type is def(foo: str) -> int
the severity group captures the text note: Revealed type is def(foo.
With more colons, the group ever expands; given
main:2: note: Revealed type is def(foo: str, bar: int, baz: float) -> int
the severity group matches note: Revealed type is def(foo: str, bar: int, baz.
See https://regex101.com/r/wOwuXG/1 for how the groups are filled.
Please match only non-colon text for severity:
(?P<severity>[^:]*)
to prevent this. See https://regex101.com/r/sM2uam/1 for a demo.
The way that out lines are matched is not allowing for colons in the output message, because the
severitygroup can capture up to the last colon in the message:Given a typical input with type annotations in a function:
the
severitygroup captures the textnote: Revealed type is def(foo.With more colons, the group ever expands; given
the
severitygroup matchesnote: Revealed type is def(foo: str, bar: int, baz.See https://regex101.com/r/wOwuXG/1 for how the groups are filled.
Please match only non-colon text for severity:
(?P<severity>[^:]*)to prevent this. See https://regex101.com/r/sM2uam/1 for a demo.