From 0507f6f7c13d7e1a0626050f085e10f7818a63d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Wed, 12 Jun 2024 10:51:58 +0100 Subject: [PATCH] Fix sphinx docs linting --- .github/sphinx-problem-matcher.json | 15 +++++++++++++++ .github/workflows/lint.yml | 12 ++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .github/sphinx-problem-matcher.json diff --git a/.github/sphinx-problem-matcher.json b/.github/sphinx-problem-matcher.json new file mode 100644 index 000000000..0bfcf0ef4 --- /dev/null +++ b/.github/sphinx-problem-matcher.json @@ -0,0 +1,15 @@ +{ + "problemMatcher": [ + { + "owner": "sphinx", + "pattern": [ + { + "regexp": "^([^:]+):(\\d+): (WARNING: )?(.+)$", + "file": 1, + "line": 2, + "message": 4 + } + ] + } + ] +} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 20847586a..855f9d731 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -118,7 +118,11 @@ jobs: - name: Install dependencies run: poetry install --only=docs - - uses: sphinx-doc/github-problem-matcher@master - name: Build docs - with: - run: poe docs + - name: Add Sphinx problem matcher + run: echo "::add-matcher::.github/sphinx-problem-matcher.json" + + - name: Build docs + run: | + poe docs |& tee /tmp/output + # fail the job if there are issues + grep -q " WARNING:" /tmp/output && exit 1 || exit 0