Merge "Default warning-is-error to True for non-legacy Sphinx projects"

This commit is contained in:
Zuul 2018-05-30 15:02:16 +00:00 committed by Gerrit Code Review
commit 9050a21a1f
2 changed files with 10 additions and 6 deletions

View File

@ -19,8 +19,10 @@ Run sphinx to generate documentation
.. zuul:rolevar:: sphinx_warning_is_error
Whether to treat sphinx build warnings as errors. Defaults to undefined
which means to attempt to find the setting in a setup.cfg file.
Whether to treat sphinx build warnings as errors. Defaults to the value of
``[build_sphinx] warning-is-error`` in ``setup.cfg`` if defined, ``False``
if the ``[build_sphinx]`` section is present but the ``warning-is-error``
option is undefined, or ``True`` if the entire section is undefined.
.. zuul:rolevar:: zuul_work_virtualenv
:default: ~/.venv

View File

@ -68,7 +68,7 @@ def main():
)
project_dir = module.params['project_dir']
warning_is_error = False
warning_is_error = True
# TODO(mordred) Remove autodoc_index_modules logic when we get OpenStack
# projects off of the pbr autoindex
autodoc_index_modules = False
@ -91,9 +91,11 @@ def main():
autodoc_index_modules=autodoc_index_modules,
msg="Error reading setup.cfg, defaulting flags to false")
if (c.has_section('build_sphinx') and
c.has_option('build_sphinx', 'warning-is-error')):
warning_is_error = c.getboolean('build_sphinx', 'warning-is-error')
if c.has_section('build_sphinx'):
if c.has_option('build_sphinx', 'warning-is-error'):
warning_is_error = c.getboolean('build_sphinx', 'warning-is-error')
else:
warning_is_error = False
if c.has_section('pbr') and c.has_option('pbr', 'autodoc_index_modules'):
autodoc_index_modules = c.getboolean('pbr', 'autodoc_index_modules')
if (c.has_section('pbr') and