Commit 4aff2dfd authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

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: default avatarJim 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 7a372bbe
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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
}