From 4aff2dfda7a7381620d8d80a53df0240d7fb58bc Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 3 Sep 2021 01:39:08 +0000 Subject: [PATCH] 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 Change-Id: Ib2ff0f0432ce3e2853526223c0ad00176d84a78c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9391 Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Jacek Kalwas Reviewed-by: Dong Yi Reviewed-by: Xiaodong Liu Reviewed-by: Tomasz Zawadzki Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index db5acc705e..40c34dd5d0 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -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 }