From 642b89f4964fc3547edef2ee5941a312f1733553 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 1 Jul 2021 10:43:50 +0200 Subject: [PATCH] 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 Change-Id: Ia03095e9cc8cf11602dafb5bef28265abb485704 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8577 Reviewed-by: Pawel Piatek Reviewed-by: Jim Harris Reviewed-by: Paul Luse Reviewed-by: Shuhei Matsumoto Reviewed-by: Karol Latecki Tested-by: SPDK CI Jenkins --- scripts/check_format.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 22e58ae64..7baa74371 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -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 }