Skip to content

Commit

Permalink
Make sphinx fail on any warnings (#36)
Browse files Browse the repository at this point in the history
This change adds `nitpicky=True` (which is an equivalent of `-n`) to
make Sphinx emit warnings for any references to non-existing targets.
Then, it adds `-W` to make it fail whenever a single warning is seen.
Finally, `--keep-going` allows Sphinx to print out all the warnings
before exiting instead of showing just one and bailing.

Resolves #29

Refs:
* https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-n
* https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-W
* https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-keep-going
  • Loading branch information
webknjaz authored Apr 26, 2021
1 parent 6c1c45b commit 8698127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@
],
)
}

# Be strict about any broken references:
nitpicky = True
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extras =
testing
changedir = docs
commands =
python -m sphinx . {toxinidir}/build/html
python -m sphinx -W --keep-going . {toxinidir}/build/html

[testenv:release]
skip_install = True
Expand Down

0 comments on commit 8698127

Please sign in to comment.