-
Notifications
You must be signed in to change notification settings - Fork 300
Docs warning to error #3877
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs warning to error #3877
Conversation
* master: Use napolean extension in docs to handle numpy docstrings too (SciTools#3871) Added whats new for pr3873 (SciTools#3874) linkcheck ignore for iris pull and issue url (SciTools#3873) Remove all local table of contents (SciTools#3872) Added whats new entry for pr3852 (SciTools#3854)
| ``.readthedocs.yml``. | ||
| .. note:: In order to preserve a clean build for the html, all **warnings** | ||
| have been promoted to be **errors** to ensure they are addressed. | ||
| This **only** applies when ``make html`` is run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW in general, is it best to go with
.. note::
<content>
rather than
.. note:: <content>
Just curious if you have an opinion/care, or indeed, whether it really matters? (most likely not)
For most sphinx directives it's the former pattern rather than the latter 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either is ok in my books. I prefer the latter as it helps the note be more visual - but this is my preference. If you have a particularly long note then the first option may be better as there is more text per line (due to no indentation)
…rror * upstream/master: Added include for common links file (SciTools#3876) Whats new for pr3871 (SciTools#3875)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkknight Lovely.
This elevates the docs to be a first class citizen and ensures that we don't bank broken docs... you've worked incredibly hard to get us to this point. Thank you!
Awesome sauce 💯 🍻 🥳 🎉
🚀 Pull Request
Description
Configured sphinx-build to promote warnings to errors when building the documentation via
make html.Updated the Makefile to use two new arguments:
-W. Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.--keep-going. With -W option, keep going processing when getting warnings to the end of build, and sphinx-build exits with exit status 1.Also updated the
contributing to the documentationin the Iris docs to state that warnings are promoted to errors.For more info see https://www.sphinx-doc.org/en/master/man/sphinx-build.html?highlight=--keep-going#cmdoption-sphinx-build-W
Why do this?
Before the overhaul of the Iris docs (#3752), there were many warnings in the build but were not actively fixed as no error was raised and the travis task completed ok.
Why not promote all warnings to errors?
I believe the Travis jobs (of a task) will currently fail correctly for the following:
make gallerytestmake doctestmake linkcheckFor
make html-noplot(skip the gallery creation) it could be applied but this is usually used as a quick way to build the docs and themake htmlthat is part of the travis jobs (and can be run manually) will capture any issues anyway.Consult Iris pull request check list