X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=ensure-documented.sh;h=434e06c46ce9eb48af0af8e38654f07300daf72e;hb=refs%2Fheads%2Fv0.24.x;hp=a2ca07217858836bb81d12a9a236dc92f3d20686;hpb=2e09a8efe9497d2253810c2523047abf0253c8e9;p=releng%2Fglobal-jjb.git diff --git a/ensure-documented.sh b/ensure-documented.sh index a2ca0721..434e06c4 100755 --- a/ensure-documented.sh +++ b/ensure-documented.sh @@ -11,11 +11,11 @@ # Checks for JJB documentation interest points and ensures they are documented. -jjb_files=($(find jjb -name "*.yaml")) +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