This script is a dumb script that checks that there is an equivalent
marking in docs/ for each yaml section. This patch also resolves a
bug in the script where it was not detecting all undocumented items.
Change-Id: Id33c8eae06e47256d53457eaa57c21cf7634ee19
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
undocumented_count=0
for file in "${jjb_files[@]}"; do
- docs_interests=$(grep -e '\- builder:' \
+ mapfile -t docs_interests < <(grep -e '\- builder:' \
-e '\- job-group:' \
-e '\- job-template:' \
-e '\- parameter:' \
-e '\- trigger:' \
-e '\- wrapper:' \
-A1 "$file" \
- | grep 'name: ' | awk -F': ' '{print $2}' | awk -F"'" '{print $2}' | sort | uniq)
+ | grep 'name: ' | awk -F': ' '{print $2}' | sort | uniq \
+ | tr -d "'")
for item in "${docs_interests[@]}"; do
if ! grep -q "$item" "docs/${file//.yaml/.rst}"; then
- echo "$item"
+ echo "$file:$item"
let "undocumented_count++"
fi
done
[tox]
minversion = 1.6
-envlist = coala,jjb,jjb-compare-xml,license
+envlist = coala,ensure-documented,jjb,jjb-compare-xml,license
skipsdist = true
[testenv:coala]