From dfd951ed9b9eb4af2452764edd808599b5e8901e Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Sat, 19 Oct 2024 01:42:20 -0400 Subject: [PATCH] [CI/Build] Add error matching for ruff output (#9513) Signed-off-by: Russell Bryant --- .github/workflows/matchers/ruff.json | 17 +++++++++++++++++ .github/workflows/ruff.yml | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/matchers/ruff.json diff --git a/.github/workflows/matchers/ruff.json b/.github/workflows/matchers/ruff.json new file mode 100644 index 00000000..f6d4479e --- /dev/null +++ b/.github/workflows/matchers/ruff.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "ruff", + "pattern": [ + { + "regexp": "^(.+?):(\\d+):(\\d+): (\\w+): (.+)$", + "file": 1, + "line": 2, + "column": 3, + "code": 4, + "message": 5 + } + ] + } + ] + } diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index b88907e4..9cc8a9e9 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -28,7 +28,8 @@ jobs: pip install -r requirements-lint.txt - name: Analysing the code with ruff run: | - ruff check . + echo "::add-matcher::.github/workflows/matchers/ruff.json" + ruff check --output-format github . - name: Spelling check with codespell run: | codespell --toml pyproject.toml