Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b86c20

Browse files
ezio-melottihugovkzooba
authored
Use sphinx-lint inmake check. (#866)
* Use sphinx-lint in `make check`.* Fix missing newlines at the end of files.* Add `venv` as a dependency for the `check` target.Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>* Specify `sphinx-lint` version in `make.bat`.Co-authored-by: Steve Dower <steve.dower@microsoft.com>Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>Co-authored-by: Steve Dower <steve.dower@microsoft.com>
1 parent7dad04b commit7b86c20

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

‎Makefile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ VENVDIR = ./venv
77
BUILDDIR = _build
88
SPHINXOPTS =
99
SPHINXBUILD =$(VENVDIR)/bin/sphinx-build
10+
SPHINXLINT =$(VENVDIR)/bin/sphinx-lint
1011
PAPER =
1112

1213
# Internal variables.
@@ -153,8 +154,9 @@ doctest: venv
153154
htmlview: html
154155
$(PYTHON) -c"import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))"
155156

156-
check:
157-
$(PYTHON) tools/rstlint.py -i tools -i venv
157+
check: venv
158+
# Ignore the tools and venv dirs and check that the default role is not used.
159+
$(SPHINXLINT) -i tools -i$(VENVDIR) --enable default-role
158160

159161
serve:
160162
@echo"The 'serve' target was removed, use 'htmlview' instead"\

‎gh-faq.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ particularly useful outside of the change log.
117117

118118
.. _bpo:https://bugs.python.org/
119119
.. _GitHub search syntax:https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax
120-
.. _advanced search:https://github.com/search/advanced
120+
.. _advanced search:https://github.com/search/advanced

‎make.bat‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ if "%PYTHON%" == "" (
1010
setPYTHON=py-3
1111
)
1212

13+
ifnotdefined SPHINXLINT (
14+
%PYTHON% -c"import sphinxlint">nul2>nul
15+
iferrorlevel1 (
16+
echo Installing sphinx-lint with%PYTHON%
17+
rem Should have been installed with Sphinx earlier
18+
%PYTHON% -m pip install"sphinx-lint<1"
19+
iferrorlevel1exit /B
20+
)
21+
setSPHINXLINT=%PYTHON% -m sphinxlint
22+
)
23+
1324
setBUILDDIR=_build
1425
setALLSPHINXOPTS=-d%BUILDDIR%/doctrees%SPHINXOPTS% .
1526
ifNOT"%PAPER%"=="" (
@@ -202,7 +213,8 @@ results in %BUILDDIR%/doctest/output.txt.
202213
)
203214

204215
:check
205-
cmd /C%PYTHON% tools\rstlint.py -i tools -i venv
216+
rem Ignore the tools and venv dirs and check that the default role is not used.
217+
cmd /S /C"%SPHINXLINT% -i tools -i venv --enable default-role"
206218
goto end
207219

208220
:serve

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Sphinx==4.5.0
22
furo<2022.4.8
33
sphinx_copybutton>=0.3.3
4+
sphinx-lint<1

‎setup.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,4 +556,4 @@ every rule.
556556
Various tools that are (or have been) used to maintain Python.
557557

558558

559-
.. _issue tracker:https://github.com/python/cpython/issues
559+
.. _issue tracker:https://github.com/python/cpython/issues

‎silencewarnings.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ If you decide to tackle a warning you have found, open an issue on the `issue
1515
tracker`_ (if one has not already been opened) and say you are going to try and
1616
tackle the issue, and then proceed to fix the issue.
1717

18-
.. _issue tracker:https://github.com/python/cpython/issues
18+
.. _issue tracker:https://github.com/python/cpython/issues

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp