Skip to content

Commit

Permalink
17189: referee's suggestions: only undefined warnings don't trigger a…
Browse files Browse the repository at this point in the history
…n exception
  • Loading branch information
nthiery committed Oct 21, 2014
1 parent b7e0a69 commit fb43b19
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/doc/common/custom-sphinx-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ def term_width_line(text):
re.compile('Exception occurred'),
re.compile('Sphinx error'))

# Unless this is the first pass of the compilation (where some cross
# links may not be resolvable yet), or we are compiling the latex
# documentation, we want all warnings to raise an exception.
if 'multidoc_first_pass=1' not in sys.argv and 'latex' not in sys.argv:
warnings += (re.compile('WARNING'),)
# We want all warnings to actually be errors.
# Exceptions:
# - warnings upon building the LaTeX documentation
# - undefined labels upon the first pass of the compilation: some
# cross links may legitimately not yet be resolvable at this point.
if 'latex' not in sys.argv:
if 'multidoc_first_pass=1' in sys.argv:
# Catch all warnings except 'WARNING: undefined label'
warnings += (re.compile('WARNING: (?!undefined label)'),)
else:
warnings += (re.compile('WARNING:'),)


# Do not error out at the first warning, sometimes there is more
Expand Down

0 comments on commit fb43b19

Please sign in to comment.