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

lint: Disable literal-block only on 3.12 or newer#241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rffontenelle merged 4 commits intomainfromrffontenelle-filter-version-lint
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletionsrequirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
potodo==0.21.3
powrap==1.0.1
sphinx-intl==2.2.0
# avoid unnecessary parentheses search in old Python Docs
sphinx-lint==1.0.0; python_version >= "3.12"
sphinx-lint==0.9.1; python_version < "3.12"
sphinx-lint==1.0.0
18 changes: 11 additions & 7 deletionsscripts/lint.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,13 +20,17 @@ touch logs/sphinxlint.txt

cd cpython/Doc

# 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 -q -D gettext_compact=0 -d build/.doctrees . build/gettext'
make build ALLSPHINXOPTS="$opts"
# Update translation files with latest POT
sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
# If version is 3.12 or newer, then disable literal-block, generate POT 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'
sphinx-intl update -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null
else
alias sphinx-lint='sphinx-lint --disable unnecessary-parentheses'
fi

cd locales/${PYDOC_LANGUAGE}/LC_MESSAGES
set +e
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp