X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=ensure-documented.sh;h=b24e40c84401b70ca388c52731f550c86c622e01;hb=7177ce9f9291a1cf2fa99fe6ff75e279ed4465ef;hp=a2ca07217858836bb81d12a9a236dc92f3d20686;hpb=391e8138f528a720604ed9da7bda949b5e56fbec;p=releng%2Fglobal-jjb.git diff --git a/ensure-documented.sh b/ensure-documented.sh index a2ca0721..b24e40c8 100755 --- a/ensure-documented.sh +++ b/ensure-documented.sh @@ -11,12 +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:' \ - -e '\- job-group:' \ + mapfile -t docs_interests < <(grep -e '\- builder:' \ -e '\- job-template:' \ -e '\- parameter:' \ -e '\- property:' \ @@ -25,12 +24,13 @@ 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 "'" | tr -d '"') for item in "${docs_interests[@]}"; do if ! grep -q "$item" "docs/${file//.yaml/.rst}"; then - echo "$item" - let "undocumented_count++" + echo "$file:$item" + (( undocumented_count++ )) fi done done