From ef2f16bc4824ca2b10b7f2845baf4d313c9c0da1 Mon Sep 17 00:00:00 2001 From: David Smith Date: Sun, 1 Jun 2025 22:38:04 +0100 Subject: Refs #36485 -- Added sphinx-lint support and make lint rule for docs. This adds a `lint.py` script to run sphinx-lint on Django's docs files, a mathing `lint` target in the `docs/Makefile` and `docs/make.bat`, and updates `docs/requirements.txt` accordingly. --- docs/make.bat | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'docs/make.bat') diff --git a/docs/make.bat b/docs/make.bat index 8376db57f0..27e3c1143d 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -36,6 +36,7 @@ if "%1" == "help" ( echo. doctest to run all doctests embedded in the documentation if enabled echo. spelling to check for typos in documentation echo. black to apply the black formatting to code blocks in documentation + echo. lint to check for linting errors in documentation goto end ) @@ -198,6 +199,11 @@ if "%1" == "black" ( goto end ) +if "%1" == "lint" ( + call :run_lint + goto end +) + if "%1" == "check" ( call :run_black call :run_spelling @@ -221,4 +227,10 @@ if "%1" == "check" ( echo.Code blocks reformatted exit /b +:run_lint + python lint.py + if errorlevel 1 exit /b 1 + echo. + echo.Documentation lint complete. + :end -- cgit v1.3