Skip to content

Commit bc07c8f

Browse files
authored
Docs: move sphinx-lint to pre-commit (#105750)
1 parent dba7217 commit bc07c8f

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

.github/workflows/reusable-docs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
cache-dependency-path: 'Doc/requirements.txt'
2929
- name: 'Install build dependencies'
3030
run: make -C Doc/ venv
31-
- name: 'Check documentation'
32-
run: make -C Doc/ check
3331
- name: 'Build HTML documentation'
3432
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
3533

@@ -59,8 +57,6 @@ jobs:
5957
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
6058
6159
# This build doesn't use problem matchers or check annotations
62-
# It also does not run 'make check', as sphinx-lint is not installed into the
63-
# environment.
6460
build_doc_oldest_supported_sphinx:
6561
name: 'Docs (Oldest Sphinx)'
6662
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ repos:
55
- id: check-yaml
66
- id: trailing-whitespace
77
types_or: [c, python, rst]
8+
9+
- repo: https://github.com/sphinx-contrib/sphinx-lint
10+
rev: v0.6.7
11+
hooks:
12+
- id: sphinx-lint
13+
args: [--enable=default-role]
14+
files: ^Doc/
15+
types: [rst]

Doc/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,9 @@ dist:
216216
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
217217

218218
.PHONY: check
219-
check:
220-
# Check the docs and NEWS files with sphinx-lint.
221-
# Ignore the tools and venv dirs and check that the default role is not used.
222-
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
223-
$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
219+
check: venv
220+
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
221+
$(VENVDIR)/bin/python3 -m pre_commit run --all-files
224222

225223
.PHONY: serve
226224
serve:

Doc/constraints.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ sphinxcontrib-serializinghtml<1.2
2323

2424
# Direct dependencies of Jinja2 (Jinja is a dependency of Sphinx, see above)
2525
MarkupSafe<2.2
26-
27-
# Direct dependencies of sphinx-lint
28-
polib<1.3
29-
regex<2024

Doc/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ sphinx==6.2.0
1111

1212
blurb
1313

14-
sphinx-lint==0.6.7
1514
sphinxext-opengraph==0.7.5
1615

1716
# The theme used by the documentation is stored separately, so we need

0 commit comments

Comments
 (0)