Skip to content

Can't use colon in output lines because item parsing is too greedy #155

Description

@mjpieters

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions