Page MenuHomePhabricator

[lint] fix parsing of severity in mypy output
ClosedPublic

Authored by PiRK on Apr 6 2023, 10:37.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC0b6c042c33c6: [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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable