Skip to content

Commit

Permalink
lint: use sphinx flag to disable blocks (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
rffontenelle authored Nov 6, 2024
1 parent 54e8795 commit 35cf71a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ touch logs/sphinxlint.txt

cd cpython/Doc

# If version is 3.12 or newer, then disable literal-block, generate POT and
# If version is 3.12 or newer, then generate POT disabling literal blocks and
# update translations with fresh POT files. If version 3.11 or older,
# disable new 'unnecessary-parentheses' check, not fixed before these versions.
minor_version=$(git branch --show-current | sed 's|^3\.||')
if [ $minor_version -ge 12 ]; then
sed -i "/^\s*'literal-block',/s/ '/ #'/" conf.py
make gettext SPHINXOPTS='-q'
make gettext SPHINXOPTS='-q -Dgettext_additional_targets=["index"]'
sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
else
alias sphinx-lint='sphinx-lint --disable unnecessary-parentheses'
Expand Down

0 comments on commit 35cf71a

Please sign in to comment.