zuul-jobs/roles/sphinx/README.rst
Stephen Finucane a258aa9a3b Default warning-is-error to True for non-legacy Sphinx projects
We're trying to move away from the legacy pbr 'build_sphinx' command.
However, without the relevant section in the 'setup.cfg' file, we have
no way to determine if the user wishes to use the '-W'
(warning-is-error) flag when building docs. The current behavior for
this is to default to False, meaning documentation for projects that
previously used the pbr functionality to enable warning-is-error is
liable to slowly break as time passes.

To resolve this, default to True for packages with no [build_sphinx]
section in setup.cfg. This ensures that projects migrating to the new
PTI (which, when fully implemented, involves removing the [build_sphinx]
section from setup.cfg) will be forced to fix any warnings prior to the
migration. However, packages that have not been converted will not be
broken. Only pacakges that have already fully switched over to the new
PTI but which did not have warning-is-error enabled are at risk of
unexpected breakage, but even for those the short-term pain should
ultimately be outweighed by the long-term gain.

Change-Id: I677afef96370ead5a45cba854ba483f18a8d1247
2018-05-10 09:23:57 +01:00

36 lines
970 B
ReStructuredText

Run sphinx to generate documentation
**Role Variables**
.. zuul:rolevar:: sphinx_source_dir
:default: doc/source
Directory relative to zuul_work_dir that contains the Sphinx sources.
.. zuul:rolevar:: sphinx_build_dir
:default: doc/build
Directory relative to zuul_work_dir where build output will be put.
.. zuul:rolevar:: sphinx_builders
:default: ['html']
Which sphinx builders to run.
.. zuul:rolevar:: sphinx_warning_is_error
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
Virtualenv that sphinx is installed in.
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
Directory to operate in.