X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=ensure-documented.sh;h=12d4927484c5bf7d649bb9380da20cc218cae784;hb=refs%2Fheads%2Fv0.37.x;hp=a2ca07217858836bb81d12a9a236dc92f3d20686;hpb=2e09a8efe9497d2253810c2523047abf0253c8e9;p=releng%2Fglobal-jjb.git diff --git a/ensure-documented.sh b/ensure-documented.sh index a2ca0721..12d49274 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,11 +24,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