From e6aa3206d177de1c8d43d33c399f8a88134aad1e Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 4 Feb 2025 13:52:59 -0300 Subject: [PATCH 1/3] Add sphinx-lint check --- .github/workflows/test-translations.yml | 2 +- .github/workflows/test.yml | 1 + noxfile.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-translations.yml b/.github/workflows/test-translations.yml index 537a8df72..4c96f47da 100644 --- a/.github/workflows/test-translations.yml +++ b/.github/workflows/test-translations.yml @@ -82,6 +82,6 @@ jobs: - name: Lint translation file if: always() - run: sphinx-lint locales/${LANGUAGE}/LC_MESSAGES/messages.po + run: nox -s sphinx_lint -- locales/${{ matrix.language }}/LC_MESSAGES/messages.po env: LANGUAGE: ${{ matrix.language }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f67bad8e..96745a717 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,7 @@ jobs: noxenv: - build - linkcheck + - sphinx_lint steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/noxfile.py b/noxfile.py index 484a8d39a..f9fa1c12b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -105,3 +105,17 @@ def checkqa(session): "--all-files", "--show-diff-on-failure", ) + + +@nox.session() +def sphinx_lint(session): + """ + Check for reST format issues in source rst files, + accepting another path as positional argument. + """ + session.install("sphinx-lint==1.0.0") + target = session.posargs if len(session.posargs) >= 1 else ["source"] + session.run( + "sphinx-lint", + *target + ) From c21c40007a0f4be0e7d159a6f0f575d3881a45f8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 17:19:44 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- noxfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index f9fa1c12b..09aec7977 100644 --- a/noxfile.py +++ b/noxfile.py @@ -115,7 +115,4 @@ def sphinx_lint(session): """ session.install("sphinx-lint==1.0.0") target = session.posargs if len(session.posargs) >= 1 else ["source"] - session.run( - "sphinx-lint", - *target - ) + session.run("sphinx-lint", *target) From 3306e5b5bb504d15e162af09522d2c142566848e Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 14 Nov 2025 16:00:53 -0300 Subject: [PATCH 3/3] Simplify logic operation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 09aec7977..4df82153d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -114,5 +114,5 @@ def sphinx_lint(session): accepting another path as positional argument. """ session.install("sphinx-lint==1.0.0") - target = session.posargs if len(session.posargs) >= 1 else ["source"] + target = session.posargs or ["source"] session.run("sphinx-lint", *target)