[Python-checkins] Restore default role check in `make check`. (#92290)

ezio-melotti webhook-mailer at python.org
Sun May 15 11:35:19 EDT 2022


https://github.com/python/cpython/commit/953ab0795243900ccccaaca069d932730a86fc20
commit: 953ab0795243900ccccaaca069d932730a86fc20
branch: main
author: Ezio Melotti <ezio.melotti at gmail.com>
committer: ezio-melotti <ezio.melotti at gmail.com>
date: 2022-05-15T17:34:52+02:00
summary:

Restore default role check in `make check`. (#92290)

* 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 at 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 at palard.fr>

files:
M Doc/Makefile
M Doc/library/datetime.rst
M Doc/library/enum.rst
M Doc/make.bat

diff --git a/Doc/Makefile b/Doc/Makefile
index 3a3417bf99af3..8a757a68b6f52 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -213,8 +213,10 @@ dist:
 	rm dist/python-$(DISTVERSION)-docs-texinfo.tar
 
 check:
-	$(SPHINXLINT) -i tools -i $(VENVDIR) -i README.rst
-	$(SPHINXLINT) ../Misc/NEWS.d/next/
+	# Check the docs and NEWS files with sphinx-lint.
+	# Ignore the tools and venv dirs and check that the default role is not used.
+	$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
+	$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
 
 serve:
 	@echo "The serve target was removed, use htmlview instead (see bpo-36329)"
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index e0b28d7cb978d..bde24ec5f2e11 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -998,7 +998,7 @@ Other constructors, all class methods:
    ISO 8601 format, with the following exceptions:
 
    1. Time zone offsets may have fractional seconds.
-   2. The `T` separator may be replaced by any single unicode character.
+   2. The ``T`` separator may be replaced by any single unicode character.
    3. Ordinal dates are not currently supported.
    4. Fractional hours and minutes are not supported.
 
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 5829d4617893b..c3256c56c6366 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -126,11 +126,11 @@ Module Contents
 
    :func:`member`
 
-      Make `obj` a member.  Can be used as a decorator.
+      Make ``obj`` a member.  Can be used as a decorator.
 
    :func:`nonmember`
 
-      Do not make `obj` a member.  Can be used as a decorator.
+      Do not make ``obj`` a member.  Can be used as a decorator.
 
 
 .. versionadded:: 3.6  ``Flag``, ``IntFlag``, ``auto``
diff --git a/Doc/make.bat b/Doc/make.bat
index d9a7aa4ca7fa6..4f0b3c11f4fac 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -180,7 +180,10 @@ if EXIST "%BUILDDIR%\html\index.html" (
 goto end
 
 :check
-cmd /S /C "%SPHINXLINT% -i tools"
+rem Check the docs and NEWS files with sphinx-lint.
+rem Ignore the tools dir and check that the default role is not used.
+cmd /S /C "%SPHINXLINT% -i tools --enable default-role"
+cmd /S /C "%SPHINXLINT% --enable default-role ..\Misc\NEWS.d\next\ "
 goto end
 
 :serve



More information about the Python-checkins mailing list