summaryrefslogtreecommitdiff
path: root/sphinx/setup_command.py
diff options
context:
space:
mode:
authorTadej Janež <tadej.j@nez.si>2016-06-10 09:45:22 +0200
committerTadej Janež <tadej.j@nez.si>2016-06-30 10:18:49 +0200
commita9ffcf0d601b18d1d8e4b9b401a0f04a518b6029 (patch)
tree1f00b7457a103dedbc92061dcc1e58fa9e955db1 /sphinx/setup_command.py
parent2a5e5a553041f048da9de7634a67c30fb61fc58f (diff)
downloadsphinx-git-a9ffcf0d601b18d1d8e4b9b401a0f04a518b6029.tar.gz
Add ``--warning-is-error`` option to setup.py command
Diffstat (limited to 'sphinx/setup_command.py')
-rw-r--r--sphinx/setup_command.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py
index 0a29685a4..7df8bd6e8 100644
--- a/sphinx/setup_command.py
+++ b/sphinx/setup_command.py
@@ -73,6 +73,7 @@ class BuildDoc(Command):
('build-dir=', None, 'Build directory'),
('config-dir=', 'c', 'Location of the configuration directory'),
('builder=', 'b', 'The builder to use. Defaults to "html"'),
+ ('warning-is-error', 'W', 'Turn warning into errors'),
('project=', None, 'The documented project\'s name'),
('version=', None, 'The short X.Y version'),
('release=', None, 'The full version, including alpha/beta/rc tags'),
@@ -82,13 +83,15 @@ class BuildDoc(Command):
('copyright', None, 'The copyright string'),
('pdb', None, 'Start pdb on exception'),
]
- boolean_options = ['fresh-env', 'all-files', 'link-index']
+ boolean_options = ['fresh-env', 'all-files', 'warning-is-error',
+ 'link-index']
def initialize_options(self):
self.fresh_env = self.all_files = False
self.pdb = False
self.source_dir = self.build_dir = None
self.builder = 'html'
+ self.warning_is_error = False
self.project = ''
self.version = ''
self.release = ''
@@ -162,7 +165,8 @@ class BuildDoc(Command):
app = Sphinx(self.source_dir, self.config_dir,
self.builder_target_dir, self.doctree_dir,
self.builder, confoverrides, status_stream,
- freshenv=self.fresh_env)
+ freshenv=self.fresh_env,
+ warningiserror=self.warning_is_error)
try:
app.build(force_all=self.all_files)