diff --git a/scripts/lint.sh b/scripts/lint.sh index 6da98059a..315f8041d 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -18,18 +18,23 @@ cd "$rootdir" mkdir -p logs touch logs/sphinxlint.txt -# Disable literal blocks and update PO -sed -i "/^\s*'literal-block',/s/ '/ #'/" cpython/Doc/conf.py -./scripts/generate_templates.sh -sphinx-intl update -d cpython/Doc/locale -p cpython/Doc/build/gettext -l pt_BR +cd cpython/Doc -cd cpython/Doc/locale/${PYDOC_LANGUAGE}/LC_MESSAGES +# Disable literal blocks and update PO +sed -i "/^\s*'literal-block',/s/ '/ #'/" conf.py +# TODO: use `make -C .. gettext` when there are only Python >= 3.12 +opts='-E -b gettext -D gettext_compact=0 -d build/.doctrees . build/gettext' +make -C .. build ALLSPHINXOPTS="$opts" +# Update translation files with latest POT +sphinx-intl update -d locale -p build/gettext -l pt_BR + +cd ${PYDOC_LANGUAGE}/LC_MESSAGES sphinx-lint | tee $(realpath "$rootdir/logs/sphinxlint.txt") # Undo changes that disabled literal blocks git checkout *.po -cd $OLDPWD +cd "$rootdir" # Remove empty file if [ ! -s logs/sphinxlint.txt ]; then