From cff70281ed1fd49f3bb25c4f68489e94b11f0edf Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:08:12 +0000 Subject: [PATCH 1/4] Remove docs/Makefile and update pre-commit to use sphinx-build directly --- .pre-commit-config.yaml | 15 +++++++++------ docs/Makefile | 19 ------------------- 2 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 docs/Makefile diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 804ad23ab..164c11489 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -133,7 +133,8 @@ repos: - id: shellcheck-docs name: shellcheck-docs # We exclude SC2215 as it is a false positive for an unknown reason on Windows. - entry: uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck + entry: + uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck --shell=bash --exclude=SC2215" language: python types_or: [markdown, rst] @@ -150,7 +151,8 @@ repos: - id: shfmt-docs name: shfmt-docs - entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt + entry: + uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt --no-pad-file --command="shfmt --write --space-redirects --indent=4" language: python types_or: [markdown, rst] @@ -282,7 +284,8 @@ repos: - id: ruff-format-fix-docs name: Ruff format docs - entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff + entry: + uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff format" language: python types_or: [markdown, rst] @@ -323,7 +326,7 @@ repos: stages: [pre-commit] - id: linkcheck name: linkcheck - entry: make -C docs/ linkcheck SPHINXOPTS=-W + entry: uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build -W language: python types_or: [rst] stages: [manual] @@ -332,7 +335,7 @@ repos: - id: spelling name: spelling - entry: make -C docs/ spelling SPHINXOPTS=-W + entry: uv run --extra=dev sphinx-build -M spelling docs/source docs/build -W language: python types_or: [rst] stages: [manual] @@ -341,7 +344,7 @@ repos: - id: docs name: Build Documentation - entry: make docs + entry: uv run --extra=dev sphinx-build -M html docs/source docs/build language: python stages: [manual] pass_filenames: false diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 7aba47eda..000000000 --- a/docs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @uv run --extra=dev $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @uv run --extra=dev $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 695aef955825dd3be17850753644eacd9cf98b5a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 02:10:32 +0000 Subject: [PATCH 2/4] [pre-commit.ci lite] apply automatic fixes --- .pre-commit-config.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 164c11489..de9a52f52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -133,8 +133,7 @@ repos: - id: shellcheck-docs name: shellcheck-docs # We exclude SC2215 as it is a false positive for an unknown reason on Windows. - entry: - uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck + entry: uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck --shell=bash --exclude=SC2215" language: python types_or: [markdown, rst] @@ -151,8 +150,7 @@ repos: - id: shfmt-docs name: shfmt-docs - entry: - uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt + entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt --no-pad-file --command="shfmt --write --space-redirects --indent=4" language: python types_or: [markdown, rst] @@ -284,8 +282,7 @@ repos: - id: ruff-format-fix-docs name: Ruff format docs - entry: - uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff + entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff format" language: python types_or: [markdown, rst] @@ -326,7 +323,8 @@ repos: stages: [pre-commit] - id: linkcheck name: linkcheck - entry: uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build -W + entry: uv run --extra=dev sphinx-build -M linkcheck docs/source docs/build + -W language: python types_or: [rst] stages: [manual] @@ -335,7 +333,8 @@ repos: - id: spelling name: spelling - entry: uv run --extra=dev sphinx-build -M spelling docs/source docs/build -W + entry: uv run --extra=dev sphinx-build -M spelling docs/source docs/build + -W language: python types_or: [rst] stages: [manual] From 3685694b94abab34a8b72708487ff3d953c61b0e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:12:10 +0000 Subject: [PATCH 3/4] Update base Makefile to use sphinx-build directly --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index e7c51da19..e6ee537af 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,4 @@ SHELL := /bin/bash -euxo pipefail - -# Treat Sphinx warnings as errors -SPHINXOPTS := -W - .PHONY: update-secrets update-secrets: # After updating secrets, commit the new secrets.tar.gpg file. @@ -11,7 +7,7 @@ update-secrets: .PHONY: docs docs: - make -C docs clean html SPHINXOPTS=$(SPHINXOPTS) + uv run --extra=dev sphinx-build -M html docs/source docs/build -W .PHONY: open-docs open-docs: From 6154730dd1d5668e4869e35d0f2c8cd389a4061d Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:22:53 +0000 Subject: [PATCH 4/4] Add -W flag to docs hook for consistent error handling --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de9a52f52..046d35636 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -343,7 +343,7 @@ repos: - id: docs name: Build Documentation - entry: uv run --extra=dev sphinx-build -M html docs/source docs/build + entry: uv run --extra=dev sphinx-build -M html docs/source docs/build -W language: python stages: [manual] pass_filenames: false