File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ def html(buildername='html'):
43
43
options = "-D plot_formats=\" [('png', 80)]\" "
44
44
else :
45
45
options = ''
46
+ if warnings_as_errors :
47
+ options = options + ' -W'
46
48
if os .system ('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options , buildername , buildername )):
47
49
raise SystemExit ("Building HTML failed." )
48
50
@@ -136,6 +138,7 @@ def all():
136
138
137
139
138
140
small_docs = False
141
+ warnings_as_errors = False
139
142
140
143
# Change directory to the one containing this file
141
144
current_dir = os .getcwd ()
@@ -180,9 +183,14 @@ def all():
180
183
parser .add_argument ("--small" ,
181
184
help = "Smaller docs with only low res png figures" ,
182
185
action = "store_true" )
186
+ parser .add_argument ("--warningsaserrors" ,
187
+ help = "Turn Sphinx warnings into errors" ,
188
+ action = "store_true" )
183
189
args = parser .parse_args ()
184
190
if args .small :
185
191
small_docs = True
192
+ if args .warningsaserrors :
193
+ warnings_as_errors = True
186
194
187
195
if args .cmd :
188
196
for command in args .cmd :
You can’t perform that action at this time.
0 commit comments