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: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia03095e9cc8cf11602dafb5bef28265abb485704
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8577
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Michal Berger 2021-07-01 10:43:50 +02:00 committed by Tomasz Zawadzki
parent 05dc895bea
commit 642b89f496

View File

@ -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
}