Skip to content

Commit 4d23e9f

Browse files
authored
lint: Disable literal-block only on 3.12 or newer
1 parent 9e898a9 commit 4d23e9f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

scripts/lint.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ 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.
25+
minor_version=$(git branch --show-current | sed 's|^3\.||')
26+
if [ $minor_version -ge 12 ]; then
27+
sed -i "/^\s*'literal-block',/s/ '/ #'/" conf.py
28+
make gettext
29+
sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
30+
fi
3031

3132
cd locales/${PYDOC_LANGUAGE}/LC_MESSAGES
3233
set +e

0 commit comments

Comments
 (0)