Skip to content

Conversation

@tkknight
Copy link
Contributor

🚀 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 documentation in 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 gallerytest
  • make doctest
  • make linkcheck

For 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 the make html that is part of the travis jobs (and can be run manually) will capture any issues anyway.


Consult Iris pull request check list

* 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)
@tkknight tkknight requested a review from bjlittle September 22, 2020 13:15
@tkknight tkknight marked this pull request as ready for review September 22, 2020 13:15
``.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.
Copy link
Member

@bjlittle bjlittle Sep 22, 2020

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 🤔

Copy link
Contributor Author

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)
Copy link
Member

@bjlittle bjlittle left a 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 💯 🍻 🥳 🎉

@bjlittle bjlittle merged commit 604ac0a into SciTools:master Sep 22, 2020
@tkknight tkknight deleted the docs_warning_to_error branch September 22, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants