diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a58f62588..e1627c0dd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -396,6 +396,7 @@ misc: - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'` - xmllint --noout --nonet --html `git ls-files '*.html'` - sh util/check-win32util-configure + - sh util/check-categories.sh needs: [] artifacts: paths: diff --git a/util/check-categories.sh b/util/check-categories.sh index dff066796d..4e582f5d9b 100644 --- a/util/check-categories.sh +++ b/util/check-categories.sh @@ -7,12 +7,21 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -list1=`grep LOGCATEGORY lib/*/include/*/*.h bin/named/include/named/*.h | -grep "#define.*(&" | -sed -e 's/.*LOGCATEGORY_\([A-Z_]*\).*/\1/' -e 's/^RRL$/rate-limit/' | -tr '[A-Z]' '[a-z]' | -tr _ - | sed 's/^tat$/trust-anchor-telemetry/' | sort -u` -list2=`sed -n 's;.*\(.*\);\1;p' doc/arm/logging-categories.xml | tr '[A-Z]' '[a-z]' | sort -u` +list1=$( + grep LOGCATEGORY lib/*/include/*/*.h bin/named/include/named/*.h | + grep "#define.*(&" | + sed -e 's/.*LOGCATEGORY_\([A-Z_]*\).*/\1/' -e 's/^RRL$/rate-limit/' | + tr '[A-Z]' '[a-z]' | + tr _ - | + sed 's/^tat$/trust-anchor-telemetry/' | + sort -u +) +list2=$( + awk '$1 == "|" && $3 == "|" && $NF == "|" && $2 ~ /^``.*``$/ { print $2 }' doc/arm/logging-categories.rst | + sed 's/``//g' | + sort -u +) +status=0 for i in $list1 do ok=no @@ -26,6 +35,7 @@ do if test $ok = no then echo "$i missing from documentation." + status=1 fi done for i in $list2 @@ -41,5 +51,7 @@ do if test $ok = no then echo "$i not in code." + status=1 fi done +exit $status