Skip to content

Commit ac4bc20

Browse files
Merge pull request #2480 from VWS-Python/sphinx-lint
Add sphinx-lint
2 parents 5ca694e + d502e50 commit ac4bc20

File tree

2 files changed

+70
-60
lines changed

2 files changed

+70
-60
lines changed

.pre-commit-config.yaml

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11
---
22
fail_fast: true
33

4+
# We use system Python, with required dependencies specified in pyproject.toml.
5+
# We therefore cannot use those dependencies in pre-commit CI.
6+
ci:
7+
skip:
8+
- actionlint
9+
- sphinx-lint
10+
- check-manifest
11+
- custom-linters
12+
- deptry
13+
- doc8
14+
- docs
15+
- interrogate
16+
- interrogate-docs
17+
- linkcheck
18+
- mypy
19+
- mypy-docs
20+
- pylint
21+
- pyproject-fmt-fix
22+
- pyright
23+
- pyright-docs
24+
- pyright-verifytypes
25+
- pyroma
26+
- ruff-check-fix
27+
- ruff-check-fix-docs
28+
- ruff-format-fix
29+
- ruff-format-fix-docs
30+
- docformatter
31+
- shellcheck
32+
- shellcheck-docs
33+
- shfmt
34+
- shfmt-docs
35+
- spelling
36+
- vulture
37+
- vulture-docs
38+
- yamlfix
39+
440
# See https://pre-commit.com for more information
541
# See https://pre-commit.com/hooks.html for more hooks
642
default_install_hook_types: [pre-commit, pre-push, commit-msg]
@@ -49,29 +85,29 @@ repos:
4985
language: python
5086
types_or: [yaml, python]
5187
pass_filenames: false
52-
additional_dependencies: [uv==0.4.25]
88+
additional_dependencies: [uv==0.5.14]
5389

5490
- id: actionlint
5591
name: actionlint
5692
entry: uv run --extra=dev actionlint
5793
language: python
5894
pass_filenames: false
5995
types_or: [yaml]
60-
additional_dependencies: [uv==0.4.25]
96+
additional_dependencies: [uv==0.5.14]
6197

6298
- id: docformatter
6399
name: docformatter
64100
entry: uv run --extra=dev -m docformatter --in-place
65101
language: python
66102
types_or: [python]
67-
additional_dependencies: [uv==0.4.25]
103+
additional_dependencies: [uv==0.5.14]
68104

69105
- id: shellcheck
70106
name: shellcheck
71107
entry: uv run --extra=dev shellcheck --shell=bash
72108
language: python
73109
types_or: [shell]
74-
additional_dependencies: [uv==0.4.25]
110+
additional_dependencies: [uv==0.5.14]
75111

76112
- id: shellcheck-docs
77113
name: shellcheck-docs
@@ -80,22 +116,22 @@ repos:
80116
--shell=bash --exclude=SC2215"
81117
language: python
82118
types_or: [markdown, rst]
83-
additional_dependencies: [uv==0.4.25]
119+
additional_dependencies: [uv==0.5.14]
84120

85121
- id: shfmt
86122
name: shfmt
87123
entry: shfmt --write --space-redirects --indent=4
88124
language: python
89125
types_or: [shell]
90-
additional_dependencies: [uv==0.4.25]
126+
additional_dependencies: [uv==0.5.14]
91127

92128
- id: shfmt-docs
93129
name: shfmt-docs
94130
entry: uv run --extra=dev doccmd --language=shell --language=console --skip-marker=shfmt
95131
--no-pad-file --command="shfmt --write --space-redirects --indent=4"
96132
language: python
97133
types_or: [markdown, rst]
98-
additional_dependencies: [uv==0.4.25]
134+
additional_dependencies: [uv==0.5.14]
99135

100136
- id: mypy
101137
name: mypy
@@ -104,7 +140,7 @@ repos:
104140
language: python
105141
types_or: [python, toml]
106142
pass_filenames: false
107-
additional_dependencies: [uv==0.4.25]
143+
additional_dependencies: [uv==0.5.14]
108144

109145
- id: mypy-docs
110146
name: mypy-docs
@@ -119,7 +155,7 @@ repos:
119155
entry: uv run --extra=dev -m check_manifest
120156
language: python
121157
pass_filenames: false
122-
additional_dependencies: [uv==0.4.25]
158+
additional_dependencies: [uv==0.5.14]
123159

124160
- id: pyright
125161
name: pyright
@@ -128,7 +164,7 @@ repos:
128164
language: python
129165
types_or: [python, toml]
130166
pass_filenames: false
131-
additional_dependencies: [uv==0.4.25]
167+
additional_dependencies: [uv==0.5.14]
132168

133169
- id: pyright-docs
134170
name: pyright-docs
@@ -144,46 +180,46 @@ repos:
144180
language: python
145181
pass_filenames: false
146182
types_or: [python]
147-
additional_dependencies: [uv==0.4.25]
183+
additional_dependencies: [uv==0.5.14]
148184

149185
- id: vulture
150186
name: vulture
151187
entry: uv run --extra=dev -m vulture .
152188
language: python
153189
types_or: [python]
154190
pass_filenames: false
155-
additional_dependencies: [uv==0.4.25]
191+
additional_dependencies: [uv==0.5.14]
156192

157193
- id: vulture-docs
158194
name: vulture docs
159195
entry: uv run --extra=dev doccmd --language=python --command="vulture"
160196
language: python
161197
types_or: [python]
162198
pass_filenames: false
163-
additional_dependencies: [uv==0.4.25]
199+
additional_dependencies: [uv==0.5.14]
164200

165201
- id: pyroma
166202
name: pyroma
167203
entry: uv run --extra=dev -m pyroma --min 10 .
168204
language: python
169205
pass_filenames: false
170206
types_or: [toml]
171-
additional_dependencies: [uv==0.4.25]
207+
additional_dependencies: [uv==0.5.14]
172208

173209
- id: deptry
174210
name: deptry
175211
entry: uv run --extra=dev -m deptry src/
176212
language: python
177213
pass_filenames: false
178-
additional_dependencies: [uv==0.4.25]
214+
additional_dependencies: [uv==0.5.14]
179215

180216
- id: pylint
181217
name: pylint
182218
entry: uv run --extra=dev -m pylint *.py src/ tests/ docs/ ci/ admin/
183219
language: python
184220
stages: [manual]
185221
pass_filenames: false
186-
additional_dependencies: [uv==0.4.25]
222+
additional_dependencies: [uv==0.5.14]
187223

188224
- id: pylint-docs
189225
name: pylint-docs
@@ -197,36 +233,36 @@ repos:
197233
entry: uv run --extra=dev -m ruff check --fix
198234
language: python
199235
types_or: [python]
200-
additional_dependencies: [uv==0.4.25]
236+
additional_dependencies: [uv==0.5.14]
201237

202238
- id: ruff-check-fix-docs
203239
name: Ruff check fix docs
204240
entry: uv run --extra=dev doccmd --language=python --command="ruff check --fix"
205241
language: python
206242
types_or: [markdown, rst]
207-
additional_dependencies: [uv==0.4.25]
243+
additional_dependencies: [uv==0.5.14]
208244

209245
- id: ruff-format-fix
210246
name: Ruff format
211247
entry: uv run --extra=dev -m ruff format
212248
language: python
213249
types_or: [python]
214-
additional_dependencies: [uv==0.4.25]
250+
additional_dependencies: [uv==0.5.14]
215251

216252
- id: ruff-format-fix-docs
217253
name: Ruff format docs
218254
entry: uv run --extra=dev doccmd --language=python --no-pad-file --command="ruff
219255
format"
220256
language: python
221257
types_or: [markdown, rst]
222-
additional_dependencies: [uv==0.4.25]
258+
additional_dependencies: [uv==0.5.14]
223259

224260
- id: doc8
225261
name: doc8
226262
entry: uv run --extra=dev -m doc8
227263
language: python
228264
types_or: [rst]
229-
additional_dependencies: [uv==0.4.25]
265+
additional_dependencies: [uv==0.5.14]
230266

231267
- id: interrogate
232268
name: interrogate
@@ -240,7 +276,7 @@ repos:
240276
entry: uv run --extra=dev doccmd --language=python --command="interrogate"
241277
language: python
242278
types_or: [markdown, rst]
243-
additional_dependencies: [uv==0.4.25]
279+
additional_dependencies: [uv==0.5.14]
244280

245281
- id: pyproject-fmt-fix
246282
name: pyproject-fmt
@@ -256,7 +292,7 @@ repos:
256292
types_or: [rst]
257293
stages: [manual]
258294
pass_filenames: false
259-
additional_dependencies: [uv==0.4.25]
295+
additional_dependencies: [uv==0.5.14]
260296

261297
- id: spelling
262298
name: spelling
@@ -265,54 +301,27 @@ repos:
265301
types_or: [rst]
266302
stages: [manual]
267303
pass_filenames: false
268-
additional_dependencies: [uv==0.4.25]
304+
additional_dependencies: [uv==0.5.14]
269305

270306
- id: docs
271307
name: Build Documentation
272308
entry: make docs
273309
language: python
274310
stages: [manual]
275311
pass_filenames: false
276-
additional_dependencies: [uv==0.4.25]
312+
additional_dependencies: [uv==0.5.14]
277313

278314
- id: yamlfix
279315
name: pyproject-fmt
280316
entry: uv run --extra=dev yamlfix
281317
language: python
282318
types_or: [yaml]
283-
additional_dependencies: [uv==0.4.25]
319+
additional_dependencies: [uv==0.5.14]
284320

285-
# We use system Python, with required dependencies specified in pyproject.toml.
286-
# We therefore cannot use those dependencies in pre-commit CI.
287-
ci:
288-
skip:
289-
- actionlint
290-
- check-manifest
291-
- custom-linters
292-
- deptry
293-
- doc8
294-
- docs
295-
- interrogate
296-
- interrogate-docs
297-
- linkcheck
298-
- mypy
299-
- mypy-docs
300-
- pylint
301-
- pyproject-fmt-fix
302-
- pyright
303-
- pyright-docs
304-
- pyright-verifytypes
305-
- pyroma
306-
- ruff-check-fix
307-
- ruff-check-fix-docs
308-
- ruff-format-fix
309-
- ruff-format-fix-docs
310-
- docformatter
311-
- shellcheck
312-
- shellcheck-docs
313-
- shfmt
314-
- shfmt-docs
315-
- spelling
316-
- vulture
317-
- vulture-docs
318-
- yamlfix
321+
- id: sphinx-lint
322+
name: sphinx-lint
323+
entry: uv run --extra=dev sphinx-lint --enable=all --disable=line-too-long
324+
README.rst CHANGELOG.rst
325+
language: python
326+
types_or: [rst]
327+
additional_dependencies: [uv==0.5.14]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ optional-dependencies.dev = [
8989
"shfmt-py==3.7.0.1",
9090
"sphinx==8.1.3",
9191
"sphinx-copybutton==0.5.2",
92+
"sphinx-lint==1.0.0",
9293
"sphinx-paramlinks==0.6",
9394
"sphinx-substitution-extensions==2025.1.2",
9495
"sphinx-toolbox==3.8.1",

0 commit comments

Comments
 (0)