Skip to content

Commit

Permalink
Fix exit status for lint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
rffontenelle committed Oct 17, 2024
1 parent 274fc20 commit 1d2a32c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ sed -i "/^\s*'literal-block',/s/ '/ #'/" conf.py
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 -d locale -p build/gettext -l pt_BR > /dev/null
sphinx-intl update -d locale -p build/gettext -l ${PYDOC_LANGUAGE} > /dev/null

cd locale/${PYDOC_LANGUAGE}/LC_MESSAGES
sphinx-lint | tee $(realpath "$rootdir/logs/sphinxlint.txt")
sphinx-lint 2> >(tee -a $(realpath "$rootdir/logs/sphinxlint.txt") >&2)

# Undo changes that disabled literal blocks
git checkout *.po
# Undo changes to undo literal blocks disabling
git checkout .

cd "$rootdir"

# Remove empty file
# Check of logfile is empty
if [ ! -s logs/sphinxlint.txt ]; then
# OK, it is empty. Remove it.
rm logs/sphinxlint.txt
else
# has contents, exit with error status (to trigger notification in CI)
exit 1
fi

0 comments on commit 1d2a32c

Please sign in to comment.