1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/bash
set -e
set -o pipefail
make -C doc dist LATEXMKOPTS=-halt-on-error SPHINXOPTS=-T 2>&1 | tee doc-log.txt
affected_doc_warnings() {
files=$(git diff --name-only origin/master...HEAD)
# Look for sphinx warnings only in files affected by the PR
if [ -n "$files" ]
then
for af in ${files[@]}
do
warn+=`grep WARNING doc-log.txt | grep $af`
done
fi
echo "$warn"
}
echo "The following documentation warnings have been generated:"
warnings=$(affected_doc_warnings)
if [ -z "$warnings" ]
then
warnings="no warnings"
fi
echo "$warnings"
|