From 9715d211c27b7cab7bd79f426a506d5183393fdc Mon Sep 17 00:00:00 2001 From: Thibaut Etienne Date: Thu, 22 Oct 2020 09:12:43 +0200 Subject: [PATCH] Add Flake8 problem matcher --- .github/workflows/build.yaml | 5 +++++ .github/workflows/matchers/flake8.json | 30 ++++++++++++++++++++++++++ .github/workflows/matchers/python.json | 18 ++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .github/workflows/matchers/flake8.json create mode 100644 .github/workflows/matchers/python.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 02ef0d9f..61e0765e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -28,6 +28,11 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Register problems matchers + run: | + echo "::add-matcher::.github/workflows/matchers/flake8.json" + echo "::add-matcher::.github/workflows/matchers/python.json" + - name: Install tox run: pip install tox diff --git a/.github/workflows/matchers/flake8.json b/.github/workflows/matchers/flake8.json new file mode 100644 index 00000000..e059a1cf --- /dev/null +++ b/.github/workflows/matchers/flake8.json @@ -0,0 +1,30 @@ +{ + "problemMatcher": [ + { + "owner": "flake8-error", + "severity": "error", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "flake8-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +} diff --git a/.github/workflows/matchers/python.json b/.github/workflows/matchers/python.json new file mode 100644 index 00000000..3e5d8d5b --- /dev/null +++ b/.github/workflows/matchers/python.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "python", + "pattern": [ + { + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", + "file": 1, + "line": 2 + }, + { + "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", + "message": 2 + } + ] + } + ] +}