Skip to content

Commit

Permalink
Merge pull request #191 from lsst-sqre/tickets/DM-40495
Browse files Browse the repository at this point in the history
DM-40495: Improve error reporting from docs-linkcheck
  • Loading branch information
rra authored Sep 1, 2023
2 parents 7d38e41 + 97dd166 commit c8d7f1c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
.PHONY: help
help:
@echo "Make targets for Safir:"
@echo "make clean - Remove generated files"
@echo "make init - Set up dev environment (install pre-commit hooks)"
@echo "make linkcheck - Check for broken links in documentation"

.PHONY: clean
clean:
rm -rf .tox
rm -rf docs/_build
rm -rf docs/api

.PHONY: init
init:
pip install --upgrade pip tox tox-docker pre-commit
pip install --upgrade -e ".[arq,db,dev,gcs,kubernetes]"
pre-commit install
rm -rf .tox

# This is defined as a Makefile target instead of only a tox command because
# if the command fails we want to cat output.txt, which contains the
# actually useful linkcheck output. tox unfortunately doesn't support this
# level of shell trickery after failed commands.
.PHONY: linkcheck
linkcheck:
sphinx-build --keep-going -n -W -T -b linkcheck docs \
docs/_build/linkcheck \
|| (cat docs/_build/linkcheck/output.txt; exit 1)
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ commands = pre-commit run --all-files

[testenv:docs]
description = Build documentation (HTML) with Sphinx.
allowlist_externals =
rm
commands =
rm -rf docs/api
sphinx-build -W --keep-going -n -T -b html -d {envtmpdir}/doctrees docs docs/_build/html

[testenv:docs-linkcheck]
description = Check links in the documentation.
allowlist_externals =
make
commands =
sphinx-build --keep-going -n -W -T -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck
make linkcheck

0 comments on commit c8d7f1c

Please sign in to comment.