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

Commit54e8795

Browse files
authored
lint: Disable literal-block only on 3.12 or newer (#241)
* lint: Disable literal-block only on 3.12 or newer* lint: disable unnecessary-parentheses check on 3.11 or older* Drop sphinx-lint==0.9.1 from requirements.txt* lint: silence output of make gettext
1 parent9e898a9 commit54e8795

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

‎requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
potodo==0.21.3
22
powrap==1.0.1
33
sphinx-intl==2.2.0
4-
# avoid unnecessary parentheses search in old Python Docs
5-
sphinx-lint==1.0.0;python_version>="3.12"
6-
sphinx-lint==0.9.1;python_version<"3.12"
4+
sphinx-lint==1.0.0

‎scripts/lint.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ touch logs/sphinxlint.txt
2020

2121
cd cpython/Doc
2222

23-
# Disable literal blocks and update PO
24-
sed -i"/^\s*'literal-block',/s/ '/ #'/" conf.py
25-
# TODO: use `make -C .. gettext` when there are only Python >= 3.12
26-
opts='-E -b gettext -q -D gettext_compact=0 -d build/.doctrees . build/gettext'
27-
make build ALLSPHINXOPTS="$opts"
28-
# Update translation files with latest POT
29-
sphinx-intl update -p build/gettext -l${PYDOC_LANGUAGE}> /dev/null
23+
# If version is 3.12 or newer, then disable literal-block, generate POT and
24+
# update translations with fresh POT files. If version 3.11 or older,
25+
# disable new 'unnecessary-parentheses' check, not fixed before these versions.
26+
minor_version=$(git branch --show-current| sed's|^3\.||')
27+
if [$minor_version-ge 12 ];then
28+
sed -i"/^\s*'literal-block',/s/ '/ #'/" conf.py
29+
make gettext SPHINXOPTS='-q'
30+
sphinx-intl update -p build/gettext -l${PYDOC_LANGUAGE}> /dev/null
31+
else
32+
alias sphinx-lint='sphinx-lint --disable unnecessary-parentheses'
33+
fi
3034

3135
cd locales/${PYDOC_LANGUAGE}/LC_MESSAGES
3236
set +e

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp