-
-
Notifications
You must be signed in to change notification settings - Fork 431
/
docs.sh
executable file
·26 lines (23 loc) · 706 Bytes
/
docs.sh
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 -eux
set -o pipefail
outdir=.github/docs
mkdir -p "$outdir"
for pkgpath in $(git ls-files | grep / | while read -r path; do dirname "$path"; done | sort -u | grep -vE '[.]git|testdata|internal|cmd/'); do
echo $pkgpath
go doc -all ./"$pkgpath" | tee "$outdir/${pkgpath////_}.txt"
done
git --no-pager diff -- .github/docs/
count_missing_mentions() {
local errors=0
for thing in $(git --no-pager diff -- .github/docs/ \
| grep -vE '[-]{3}' \
| grep -Eo '^-[^ ]+ ([^ (]+)[ (]' \
| sed 's%(% %' \
| cut -d' ' -f2); do
if ! grep -A999999 '## Sub-v0 breaking API changes' README.md | grep -F "$thing"; then
((errors++)) || true
fi
done
return $errors
}
count_missing_mentions