Bug 1737307 - 'mach doc': Add a new option --linkcheck r=mhentges DONTBUILD

Depends on D129283

Differential Revision: https://phabricator.services.mozilla.com/D129284
This commit is contained in:
Sylvestre Ledru 2021-11-29 09:28:35 +00:00
Родитель 55e4cd7d71
Коммит 5f7ee8020d
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -90,6 +90,9 @@ BASE_LINK = "http://gecko-docs.mozilla.org-l1.s3-website.us-west-2.amazonaws.com
help="Distribute the build over N processes in parallel.",
)
@CommandArgument("--write-url", default=None, help="Write S3 Upload URL to text file")
@CommandArgument(
"--linkcheck", action="store_true", help="Check if the links are still valid"
)
@CommandArgument("--verbose", action="store_true", help="Run Sphinx in verbose mode")
def build_docs(
command_context,
@ -103,6 +106,7 @@ def build_docs(
upload=False,
jobs=None,
write_url=None,
linkcheck=None,
verbose=None,
):
@ -152,6 +156,10 @@ def build_docs(
"%s: could not find docs at this location" % path
)
if linkcheck:
# We want to verify if the links are valid or not
fmt = "linkcheck"
result = _run_sphinx(docdir, savedir, fmt=fmt, jobs=jobs, verbose=verbose)
if result != 0:
print(_dump_sphinx_backtrace())