Commit 642b89f4 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

check_format: Fix git-grep pattern



Use extended regexp to resolve any potential ambiguity with matching
on '('. This should fix the following failure as seen on the CI:

fatal: command line, '^SPDK_RPC_REGISTER\(': Unmatched ( or \(

Also, since errexit doesn't see failures inside the process
substitution make sure we return from the function with a proper $rc
in case git fails early on.

Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: Ia03095e9cc8cf11602dafb5bef28265abb485704
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8577


Reviewed-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 05dc895b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -570,14 +570,16 @@ function check_changelog() {
}

function check_json_rpc() {
	local rc=0
	local rc=1

	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
	done < <(git grep -h "^SPDK_RPC_REGISTER\(" ':!test/*')
		rc=0
	done < <(git grep -h -E "^SPDK_RPC_REGISTER\(" ':!test/*')

	return $rc
}