check_format.sh: fix JSON-RPC doc checks

The check needs to fail if documentation is missing
for any RPC. But the way the check was written, the
rc would get set to 0 everytime it found docs for
an RPC. This means it would only return failure if
the last RPC that was checked did not have
documentation.

While here, add a message telling the user that
JSON-RPC docs are being checked, to be consistent
with other checks in this script.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib2ff0f0432ce3e2853526223c0ad00176d84a78c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9391
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2021-09-03 01:39:08 +00:00 committed by Tomasz Zawadzki
parent 7a372bbe12
commit 4aff2dfda7

View File

@ -570,17 +570,19 @@ function check_changelog() {
}
function check_json_rpc() {
local rc=1
local rc=0
echo -n "Checking that all RPCs are documented..."
while IFS='"' read -r _ rpc _; do
if ! grep -q "^### $rpc" doc/jsonrpc.md; then
echo "Missing JSON-RPC documentation for ${rpc}"
rc=1
continue
fi
rc=0
done < <(git grep -h -E "^SPDK_RPC_REGISTER\(" ':!test/*')
if [ $rc -eq 0 ]; then
echo " OK"
fi
return $rc
}