-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error reporting from docs-linkcheck
Sphinx doesn't summarize the linkcheck errors at the end of the output, but it does write them to output.txt. Move the link checking to a makefile target so that we can use shell trickery to output the contents of that file on link checking failures. Add help and clean targets to the Makefile, and remove docs/api when building docs to avoid stale files left-over from automodsumm.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters