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..0e2d58507 --- /dev/null +++ b/.github/problem-matchers/yapf.json @@ -0,0 +1,21 @@ +{ + "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 + } + ] + } + ] +} 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