Skip to content

Commit

Permalink
Fix script that creates doxygen documentation and reports warnings/er…
Browse files Browse the repository at this point in the history
…rors

- close #301 (CI: documentation checks fail on github actions)

- the problem arose
* because commit 3ecbdc9 removed all exceptions from `doc/doxygen_exceptions.txt` (doxygen warnings not to be reported by the script) and
* because the script `tools/run_doxygen.sh` incorrectly tested whether the file listing exceptions was empty (it reported an empty file but with return characters as not empty) by using `wc -l`
- As a consequence, the script removed all content of the doxygen log file (in error): grep was set up to match everything if the pattern inputs was empty or contained an empty line

-> now, the script `tools/run_doxygen.sh` correctly identifies if `doc/doxygen_exceptions.txt` contains exceptions or is empty (but for whitespace) by using `wc -w` (instead of `wc -l`)
-> now, the script also sends an error with a hopefully meaningful message (instead of none) if the doxygen log file turns out to be empty
  • Loading branch information
dschlaep committed Nov 30, 2022
1 parent 3d3d30c commit abcea9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/run_doxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ doxygen ${doxy} > ${log} 2>&1
# Make sure that there is such a (readable) file
if [ -r ${doxexcept} ]; then
# Make sure that there are exceptions in the file
if [ $(wc -l < ${doxexcept}) -ne 0 ]; then
if [ $(wc -w < ${doxexcept}) -ne 0 ]; then
# Remove exceptions from the logfile
grep -v -f ${doxexcept} ${log} > ${log_tmp}
grep --invert-match -f ${doxexcept} ${log} > ${log_tmp}
mv ${log_tmp} ${log}
rm -f ${log_tmp}
fi
fi

# Fail if log file is completely empty (likely a grep-parsing error)
if [ $(wc -w < ${log}) -eq 0 ]; then
echo "doxygen log file is empty pointing to a likely error."
exit 1
fi

# Examine log file for remaining warnings/errors
warnings="$(grep -iE "warning|error" ${log} 2>&1 || echo "")"
Expand Down

0 comments on commit abcea9e

Please sign in to comment.