HomePhabricator

[lint] fix parsing of severity in mypy output

Description

[lint] fix parsing of severity in mypy output

Summary:
When the message has a ":", the severity pattern is not correct, as the pattern matching takes as much text as possible (it does not stop at the first ":" if there is aother one).

These are examples of messages that were not parsed properly, causing lint errors.

contrib/teamcity/build-configurations.py:8: error: Skipping analyzing "deepmerge": module is installed, but missing library stubs or py.typed marker  [import]`
[...]
contrib/teamcity/build-configurations.py:18: error: Library stubs not installed for "yaml"  [import]
contrib/teamcity/build-configurations.py:18: note: Hint: "python3 -m pip install types-PyYAML"

Test Plan:
arc lint --everything

Add import yaml in a linted python file to trigger a message containing "note: Hint: ...", and run arc lint, check that the linter does not crash.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13596

Details

Provenance
PiRKAuthored on Apr 6 2023, 10:26
PiRKPushed on Apr 6 2023, 12:04
Reviewer
Restricted Project
Differential Revision
D13596: [lint] fix parsing of severity in mypy output
Parents
rABC091ec4f079cf: contrib: Parse ELF directly for symbol and security checks
Branches
Unknown
Tags
Unknown