File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ def html(buildername='html'):
4343 options = "-D plot_formats=\" [('png', 80)]\" "
4444 else :
4545 options = ''
46+ if warnings_as_errors :
47+ options = options + ' -W'
4648 if os .system ('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options , buildername , buildername )):
4749 raise SystemExit ("Building HTML failed." )
4850
@@ -136,6 +138,7 @@ def all():
136138
137139
138140small_docs = False
141+ warnings_as_errors = False
139142
140143# Change directory to the one containing this file
141144current_dir = os .getcwd ()
@@ -180,9 +183,14 @@ def all():
180183parser .add_argument ("--small" ,
181184 help = "Smaller docs with only low res png figures" ,
182185 action = "store_true" )
186+ parser .add_argument ("--warningsaserrors" ,
187+ help = "Turn Sphinx warnings into errors" ,
188+ action = "store_true" )
183189args = parser .parse_args ()
184190if args .small :
185191 small_docs = True
192+ if args .warningsaserrors :
193+ warnings_as_errors = True
186194
187195if args .cmd :
188196 for command in args .cmd :
You can’t perform that action at this time.
0 commit comments