We're building our documentation using Sphinx v3 with Read the Docs using sphinx.ext.napoleon and Google-style docstrings. When we build locally, Sphinx doesn't catch badly-formatted Google docstrings as warnings. For example:
"""
This should go next to the triple quotes above.
Args: there should be nothing here
sample_arg (int): there also shouldn't be anything here
Some documentation that is missing a tab at the beginning.
Missing return
"""
Building locally with make html
, this does not throw any warnings but horribly screws up how this appears on readthedocs. We have added sphinx.ext.napoleon
in our conf.py
extensions
variable and have kept the original Makefile as is except for adding the flags -W --keep-going -a -E
under SPHINXOPTS
.
Is there a way to get Sphinx to fail the build if someone tries to run make build
with bad Google-style documentation? Or do we have to live with manually looking through and identifying these errors?