From 925bc187eacbc0fbdd2c56f360a040a23cb13145 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 17 Mar 2019 07:09:19 +0100 Subject: [PATCH] Support --keep-going with BuildDoc setup command (#6180) * Support --keep-going with BuildDoc setup command This allows for `tox -e docs -- -n -W --keep-going`. --- sphinx/cmd/build.py | 2 +- sphinx/setup_command.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sphinx/cmd/build.py b/sphinx/cmd/build.py index 6fd954296..e19500901 100644 --- a/sphinx/cmd/build.py +++ b/sphinx/cmd/build.py @@ -186,7 +186,7 @@ files can be built by specifying individual filenames. group.add_argument('-W', action='store_true', dest='warningiserror', help=__('turn warnings into errors')) group.add_argument('--keep-going', action='store_true', dest='keep_going', - help=__("With -W, Keep going when getting warnings")) + help=__("With -W, keep going when getting warnings")) group.add_argument('-T', action='store_true', dest='traceback', help=__('show full traceback on exception')) group.add_argument('-P', action='store_true', dest='pdb', diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py index 9445e4e0a..06a7016d1 100644 --- a/sphinx/setup_command.py +++ b/sphinx/setup_command.py @@ -85,6 +85,7 @@ class BuildDoc(Command): ('copyright', None, 'The copyright string'), ('pdb', None, 'Start pdb on exception'), ('nitpicky', 'n', 'nit-picky mode, warn about all missing references'), + ('keep-going', None, 'With -W, keep going when getting warnings'), ] boolean_options = ['fresh-env', 'all-files', 'warning-is-error', 'link-index', 'nitpicky'] @@ -106,6 +107,7 @@ class BuildDoc(Command): self.verbosity = 0 self.traceback = False self.nitpicky = False + self.keep_going = False def _guess_source_dir(self): # type: () -> str @@ -186,7 +188,8 @@ class BuildDoc(Command): builder_target_dir, self.doctree_dir, builder, confoverrides, status_stream, freshenv=self.fresh_env, - warningiserror=self.warning_is_error) + warningiserror=self.warning_is_error, + keep_going=self.keep_going) app.build(force_all=self.all_files) if app.statuscode: raise DistutilsExecError(