File: build_docs.sh

package info (click to toggle)
scikit-optimize 0.10.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,736 kB
  • sloc: python: 10,668; javascript: 438; makefile: 139; sh: 6
file content (26 lines) | stat: -rwxr-xr-x 603 bytes parent folder | download | duplicates (2)
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"