From 714b19a974ea9e989fe365f88f8e579fd7a7670b Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 3 May 2018 18:16:53 -0400 Subject: [PATCH] Enable ensure-documented check 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 --- ensure-documented.sh | 7 ++++--- tox.ini | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ensure-documented.sh b/ensure-documented.sh index cab15fcb..434e06c4 100755 --- a/ensure-documented.sh +++ b/ensure-documented.sh @@ -15,7 +15,7 @@ mapfile -t jjb_files < <(find jjb -name "*.yaml") 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:' \ @@ -25,11 +25,12 @@ for file in "${jjb_files[@]}"; do -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 diff --git a/tox.ini b/tox.ini index 2d4d91e6..8ed03446 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = coala,jjb,jjb-compare-xml,license +envlist = coala,ensure-documented,jjb,jjb-compare-xml,license skipsdist = true [testenv:coala] -- 2.16.6