From 720282dc86e6854f7f21b2e1bdc4a2826436aa26 Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 26 Mar 2026 22:26:25 +0000 Subject: [PATCH 1/3] Add problem matcher for Yapf Add problem matcher for yapf, used in CI. --- .github/problem-matchers/README.md | 10 ++++++++-- .github/problem-matchers/yapf.json | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/problem-matchers/yapf.json diff --git a/.github/problem-matchers/README.md b/.github/problem-matchers/README.md index 60ede5cbb..7a68ff0d6 100644 --- a/.github/problem-matchers/README.md +++ b/.github/problem-matchers/README.md @@ -6,5 +6,11 @@ This directory contains Problem Matchers used by the GitHub Actions workflows in The following problem matcher JSON files found in this directory were copied from the [Home Assistant](https://github.com/home-assistant/core) project on GitHub. The Home Assistant project is licensed under the Apache 2.0 open-source license. The version of the files at the time they were copied was 2025.1.2. -- [`pylint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/pylint.json) -- [`yamllint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/yamllint.json) +* [`pylint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/pylint.json) +* [`yamllint.json`](https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/yamllint.json) + +The following problem matcher for yapf came from the [Google +SCAAML](https://github.com/google/scaaml) repository as it appeared on 2025-12-08. The last commit +was by user jmichelp on 2022-07-03. The file is licensed under the Apache 2.0 license. + +* [`yapf.json`](https://github.com/google/scaaml/blob/6d9c3a42c527212ef77f2877419dd8f6e77eb442/.github/python_matcher.json) diff --git a/.github/problem-matchers/yapf.json b/.github/problem-matchers/yapf.json new file mode 100644 index 000000000..5c72ce5bc --- /dev/null +++ b/.github/problem-matchers/yapf.json @@ -0,0 +1,22 @@ +{ + "problemMatcher": [ + { + "owner": "yapf-diff", + "pattern": [ + { + "regexp": "^---\\s*([^\\s]*)\\s*\\(original\\)$", + "file": 1 + }, + { + "regexp": "^\\+\\+\\+\\s*([^\\s]*)\\s*\\((.*)\\)$", + "message": 2 + }, + { + "regexp": "^@@\\s*-(\\d+),(\\d+)\\s*\\+(\\d+),(\\d+)\\s*@@$", + "line": 1 + } + ] + }, + } + ] +} From 02d78afd557fefbdf57afd38a9e1f18234d40317 Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 26 Mar 2026 22:27:27 +0000 Subject: [PATCH 2/3] Set up to use problem matcher when running Yapf --- .github/workflows/ci-file-checks.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-file-checks.yaml b/.github/workflows/ci-file-checks.yaml index 166af5c90..8febc24c7 100644 --- a/.github/workflows/ci-file-checks.yaml +++ b/.github/workflows/ci-file-checks.yaml @@ -333,6 +333,9 @@ jobs: path: ${{needs.Setup.outputs.cache_paths}} fail-on-cache-miss: true + - name: Set up yapf output problem matcher + run: echo '::add-matcher::.github/problem-matchers/yapf.json' + - name: Run Yapf on the Python changed files run: | set +e From 3213d647378e5333cafb1b3484bb8dcb643bcf4e Mon Sep 17 00:00:00 2001 From: mhucka Date: Thu, 26 Mar 2026 22:29:42 +0000 Subject: [PATCH 3/3] Fix syntax error --- .github/problem-matchers/yapf.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/problem-matchers/yapf.json b/.github/problem-matchers/yapf.json index 5c72ce5bc..0e2d58507 100644 --- a/.github/problem-matchers/yapf.json +++ b/.github/problem-matchers/yapf.json @@ -16,7 +16,6 @@ "line": 1 } ] - }, - } + } ] }