Skip to content

Commit

Permalink
lint.sh: run gettext builder instead if script
Browse files Browse the repository at this point in the history
Running the script brings unneeded extra requirements
  • Loading branch information
rffontenelle authored Oct 15, 2024
1 parent 8a98467 commit c11e07e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c11e07e

Please sign in to comment.