3 # Check for Documentation warnings:
4 # doxygen-warning-log.txt should be an empty file
5 # sphinx-warning-log.txt should only contain (fuzzy) matches to ../sphinx-known-warnings.txt
7 STARS='***************************************************'
9 if [ -s doxygen-warning-log.txt ]; then
11 echo "Build failed due to doxygen warnings:"
12 cat doxygen-warning-log.txt
17 # Remove escape characters, file paths, line numbers from
18 # the Sphinx warning log
19 # (escape char removal from https://www.commandlinefu.com/commands/view/6141/remove-color-codes-special-characters-with-sed
20 sed -r 's:\x1B\[[0-9;]*[mK]::g' sphinx-warning-log.txt | \
21 sed -E "s~${IDF_PATH}~\${IDF_PATH}~" | \
22 sed -E "s/:[0-9]+:/:line:/" > sphinx-warning-log-sanitized.txt
24 # diff sanitized warnings, ignoring lines which only appear in ../sphinx-known-warnings.txt
26 # format is to display only lines new or changed in second argument
27 DIFF_FORMAT="--unchanged-line-format= --old-line-format= --new-line-format=%L"
29 SPHINX_WARNINGS=$(diff $DIFF_FORMAT ../sphinx-known-warnings.txt sphinx-warning-log-sanitized.txt)
30 if ! [ -z "$SPHINX_WARNINGS" ]; then
32 echo "Build failed due to new/different Sphinx warnings:"
33 echo "$SPHINX_WARNINGS"
36 echo "(Check files ../sphinx-known-warnings.txt and sphinx-warning-log.txt for full details.)"