From ee5594fa58c94fc0c27edca4fd36c78fc79ab0e7 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:08:39 +0000 Subject: [PATCH 1/4] Remove docs/Makefile and update pre-commit to use sphinx-build directly --- .pre-commit-config.yaml | 15 +++++++++------ docs/Makefile | 20 -------------------- 2 files changed, 9 insertions(+), 26 deletions(-) delete mode 100644 docs/Makefile diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c164119..adc80ff7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -117,7 +117,8 @@ repos: - id: shellcheck-docs name: shellcheck-docs - 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" language: python types_or: [markdown, rst] @@ -134,7 +135,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] @@ -259,7 +261,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] @@ -301,7 +304,7 @@ repos: - 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] @@ -310,7 +313,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] @@ -319,7 +322,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 15e9c44b..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = VWSPYTHON -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 57db930a19e1a1a82db3723f58a6b8d9a2ea90e8 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:12:14 +0000 Subject: [PATCH 2/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 216a2574..b4612b46 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,7 @@ SHELL := /bin/bash -euxo pipefail - -# Treat Sphinx warnings as errors -SPHINXOPTS := -W - .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 82faaf5752dfe3cf76b4f860a3df04cedae388f0 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:14:08 +0000 Subject: [PATCH 3/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 adc80ff7..8a8e38b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -117,8 +117,7 @@ repos: - id: shellcheck-docs name: shellcheck-docs - 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" language: python types_or: [markdown, rst] @@ -135,8 +134,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] @@ -261,8 +259,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] @@ -304,7 +301,8 @@ repos: - 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] @@ -313,7 +311,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 eb9fb0ff6cdd0895c426be2fdc248fce87b9a5fc Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 02:22:55 +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 8a8e38b2..4236e1a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -321,7 +321,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