From 79fb722657e2a2887a8cb77401712ebd3a89054b Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 5 Jul 2020 02:19:00 +0200 Subject: [PATCH] GitHub Actions: Add flake8 problem matcher (#37465) --- .github/workflows/ci.yaml | 3 +++ .github/workflows/matchers/flake8.json | 30 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/matchers/flake8.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 390b9874b38..e39351bd939 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -308,6 +308,9 @@ jobs: run: | echo "Failed to restore Python virtual environment from cache" exit 1 + - name: Register flake8 problem matcher + run: | + echo "::add-matcher::.github/workflows/matchers/flake8.json" - name: Run flake8 run: | . venv/bin/activate diff --git a/.github/workflows/matchers/flake8.json b/.github/workflows/matchers/flake8.json new file mode 100644 index 00000000000..83163e72815 --- /dev/null +++ b/.github/workflows/matchers/flake8.json @@ -0,0 +1,30 @@ +{ + "problemMatcher": [ + { + "owner": "flake8-error", + "severity": "error", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s(E\\d{3}\\s.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "flake8-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.*):(\\d+):(\\d+):\\s([CDFNW]\\d{3}\\s.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +}