From 20a228c21b7fdaa909343f69019c000f727507b0 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 2 Aug 2020 21:54:20 +0100 Subject: [PATCH 1/2] Add flake8 problem matcher --- .github/flake8-problem-matcher.json | 17 +++++++++++++++++ .github/workflows/ci.yaml | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .github/flake8-problem-matcher.json diff --git a/.github/flake8-problem-matcher.json b/.github/flake8-problem-matcher.json new file mode 100644 index 000000000..bb8db292c --- /dev/null +++ b/.github/flake8-problem-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "flake8", + "pattern": [ + { + "regexp": "^(.*?):(\\d+):(\\d+): ([^ ]+) (.*)$", + "file": 1, + "line": 2, + "column": 3, + "code": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 08e7548f2..48d43d059 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,9 +65,6 @@ jobs: lint: runs-on: ubuntu-latest - env: - PY_COLORS: 1 - steps: - uses: actions/checkout@v2 @@ -81,5 +78,8 @@ jobs: python -m pip install --upgrade pip python -m pip install tox sphinx + - name: Add problem matcher + run: echo "::add-matcher::.github/flake8-problem-matcher.json" + - name: Lint with flake8 run: tox -e py-lint From 5d24cb0e1dded59960ea59a3191f21b4f0597ecc Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Sun, 2 Aug 2020 22:41:01 +0100 Subject: [PATCH 2/2] Include error code in message --- .github/flake8-problem-matcher.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/flake8-problem-matcher.json b/.github/flake8-problem-matcher.json index bb8db292c..52f94e05e 100644 --- a/.github/flake8-problem-matcher.json +++ b/.github/flake8-problem-matcher.json @@ -4,12 +4,11 @@ "owner": "flake8", "pattern": [ { - "regexp": "^(.*?):(\\d+):(\\d+): ([^ ]+) (.*)$", + "regexp": "^(.*?):(\\d+):(\\d+): (.*)$", "file": 1, "line": 2, "column": 3, - "code": 4, - "message": 5 + "message": 4 } ] }