From fb0562da2f027d8e4e010a806e9bd021ae04c27b Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Wed, 17 Jan 2024 11:09:02 +0000 Subject: [PATCH] feat(types): Add mypy GitHub problem matcher (#19706) --- .github/mypy-problem-matcher.json | 18 ++++++++++++++++++ .github/workflows/ci-backend.yml | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 .github/mypy-problem-matcher.json diff --git a/.github/mypy-problem-matcher.json b/.github/mypy-problem-matcher.json new file mode 100644 index 0000000000000..f87b1c492ea4d --- /dev/null +++ b/.github/mypy-problem-matcher.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "mypy", + "severity": "error", + "pattern": [ + { + "regexp": "^([^:]*):(\\d+):(?:(\\d+):)? (?:error|note): (.*?)(?: \\[(\\S+)\\])?$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index f62f587935372..570364fbe28fd 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -135,6 +135,9 @@ jobs: run: | ruff format --exclude posthog/hogql/grammar --check --diff . + - name: Add Problem Matcher + run: echo "::add-matcher::.github/mypy-problem-matcher.json" + - name: Check static typing run: | mypy -p posthog | mypy-baseline filter