X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=ensure-documented.sh;h=530c2166b2725aa308daf0b34e4eb8a6b776c97a;hb=HEAD;hp=434e06c46ce9eb48af0af8e38654f07300daf72e;hpb=68df50265903964986984e073df5cf671998befc;p=releng%2Fglobal-jjb.git diff --git a/ensure-documented.sh b/ensure-documented.sh index 434e06c4..530c2166 100755 --- a/ensure-documented.sh +++ b/ensure-documented.sh @@ -16,27 +16,26 @@ mapfile -t jjb_files < <(find jjb -name "*.yaml") undocumented_count=0 for file in "${jjb_files[@]}"; do mapfile -t docs_interests < <(grep -e '\- builder:' \ - -e '\- job-group:' \ - -e '\- job-template:' \ - -e '\- parameter:' \ - -e '\- property:' \ - -e '\- publisher:' \ - -e '\- scm:' \ - -e '\- trigger:' \ - -e '\- wrapper:' \ - -A1 "$file" \ - | grep 'name: ' | awk -F': ' '{print $2}' | sort | uniq \ - | tr -d "'") + -e '\- job-template:' \ + -e '\- parameter:' \ + -e '\- property:' \ + -e '\- publisher:' \ + -e '\- scm:' \ + -e '\- trigger:' \ + -e '\- wrapper:' \ + -A1 "$file" \ + | 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 "$file:$item" - let "undocumented_count++" + undocumented_count=$((undocumented_count+1)) fi done done -if [ $undocumented_count -gt 0 ]; then +if [ "$undocumented_count" -gt 0 ]; then echo "Number of undocumented items: $undocumented_count" exit 1 fi