Skip to content

Commit 5b2c5ae

Browse files
authored
[3.11] Restore default role check in make check. (GH-92290) (#92821)
* Restore default role check in `make check`. * Options first, then files. * Update `make.bat` too. * Add a comment explaining the extra options. * No reason to ignore the README.rst. * Enable default-role check in sphinx-lint. Co-authored-by: Julien Palard <julien@palard.fr> * Update sphinx-lint default-role check. * Fix use of the default role in the docs. * Update make.bat to check for the default role too. * Fix comment in make.bat. Co-authored-by: Julien Palard <julien@palard.fr> (cherry picked from commit 953ab07) Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent 2bcae11 commit 5b2c5ae

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Doc/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ dist:
213213
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
214214

215215
check:
216-
$(SPHINXLINT) -i tools -i $(VENVDIR) -i README.rst
217-
$(SPHINXLINT) ../Misc/NEWS.d/next/
216+
# Check the docs and NEWS files with sphinx-lint.
217+
# Ignore the tools and venv dirs and check that the default role is not used.
218+
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
219+
$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
218220

219221
serve:
220222
@echo "The serve target was removed, use htmlview instead (see bpo-36329)"

Doc/library/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ Other constructors, all class methods:
998998
ISO 8601 format, with the following exceptions:
999999

10001000
1. Time zone offsets may have fractional seconds.
1001-
2. The `T` separator may be replaced by any single unicode character.
1001+
2. The ``T`` separator may be replaced by any single unicode character.
10021002
3. Ordinal dates are not currently supported.
10031003
4. Fractional hours and minutes are not supported.
10041004

Doc/library/enum.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ Module Contents
126126

127127
:func:`member`
128128

129-
Make `obj` a member. Can be used as a decorator.
129+
Make ``obj`` a member. Can be used as a decorator.
130130

131131
:func:`nonmember`
132132

133-
Do not make `obj` a member. Can be used as a decorator.
133+
Do not make ``obj`` a member. Can be used as a decorator.
134134

135135

136136
.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``

Doc/make.bat

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ if EXIST "%BUILDDIR%\html\index.html" (
180180
goto end
181181

182182
:check
183-
cmd /S /C "%SPHINXLINT% -i tools"
183+
rem Check the docs and NEWS files with sphinx-lint.
184+
rem Ignore the tools dir and check that the default role is not used.
185+
cmd /S /C "%SPHINXLINT% -i tools --enable default-role"
186+
cmd /S /C "%SPHINXLINT% --enable default-role ..\Misc\NEWS.d\next\ "
184187
goto end
185188

186189
:serve

0 commit comments

Comments
 (0)