Skip to content

Commit

Permalink
[CI/Build] Add error matching config for mypy
Browse files Browse the repository at this point in the history
This change makes GitHub parse `mypy` output and show errors in the
diff viewer for PRs. This makes errors more easily visible inline with
the code that was changed without having to dig through CI logs.

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb committed Oct 18, 2024
1 parent 051eaf6 commit 32318c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/matchers/mypy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "mypy",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
]
}
]
}
1 change: 1 addition & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ jobs:
pip install types-setuptools
- name: Mypy
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
tools/mypy.sh

0 comments on commit 32318c7

Please sign in to comment.