diff --git a/Makefile b/Makefile index e0e6ecd73..68c1bb2cc 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ VENVDIR = ./venv BUILDDIR = _build SPHINXOPTS = SPHINXBUILD = $(VENVDIR)/bin/sphinx-build +SPHINXLINT = $(VENVDIR)/bin/sphinx-lint PAPER = # Internal variables. @@ -153,8 +154,9 @@ doctest: venv htmlview: html $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))" -check: - $(PYTHON) tools/rstlint.py -i tools -i venv +check: venv + # Ignore the tools and venv dirs and check that the default role is not used. + $(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role serve: @echo "The 'serve' target was removed, use 'htmlview' instead" \ diff --git a/gh-faq.rst b/gh-faq.rst index 7fe66c029..42b0fb61d 100644 --- a/gh-faq.rst +++ b/gh-faq.rst @@ -117,4 +117,4 @@ particularly useful outside of the change log. .. _bpo: https://bugs.python.org/ .. _GitHub search syntax: https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax -.. _advanced search: https://github.com/search/advanced \ No newline at end of file +.. _advanced search: https://github.com/search/advanced diff --git a/make.bat b/make.bat index cba6cb9d5..ca3ac39d8 100644 --- a/make.bat +++ b/make.bat @@ -10,6 +10,17 @@ if "%PYTHON%" == "" ( set PYTHON=py -3 ) +if not defined SPHINXLINT ( + %PYTHON% -c "import sphinxlint" > nul 2> nul + if errorlevel 1 ( + echo Installing sphinx-lint with %PYTHON% + rem Should have been installed with Sphinx earlier + %PYTHON% -m pip install "sphinx-lint<1" + if errorlevel 1 exit /B + ) + set SPHINXLINT=%PYTHON% -m sphinxlint +) + set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . if NOT "%PAPER%" == "" ( @@ -202,7 +213,8 @@ results in %BUILDDIR%/doctest/output.txt. ) :check -cmd /C %PYTHON% tools\rstlint.py -i tools -i venv +rem Ignore the tools and venv dirs and check that the default role is not used. +cmd /S /C "%SPHINXLINT% -i tools -i venv --enable default-role" goto end :serve diff --git a/requirements.txt b/requirements.txt index 7da0db247..071237ae9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ Sphinx==4.5.0 furo<2022.4.8 sphinx_copybutton>=0.3.3 +sphinx-lint<1 diff --git a/setup.rst b/setup.rst index 3775c5fe2..58120dc30 100644 --- a/setup.rst +++ b/setup.rst @@ -556,4 +556,4 @@ every rule. Various tools that are (or have been) used to maintain Python. -.. _issue tracker: https://github.com/python/cpython/issues \ No newline at end of file +.. _issue tracker: https://github.com/python/cpython/issues diff --git a/silencewarnings.rst b/silencewarnings.rst index 8d1ff5bff..a5f21ed0d 100644 --- a/silencewarnings.rst +++ b/silencewarnings.rst @@ -15,4 +15,4 @@ If you decide to tackle a warning you have found, open an issue on the `issue tracker`_ (if one has not already been opened) and say you are going to try and tackle the issue, and then proceed to fix the issue. -.. _issue tracker: https://github.com/python/cpython/issues \ No newline at end of file +.. _issue tracker: https://github.com/python/cpython/issues