From patchwork Mon Oct 1 20:38:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 45787 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D6B8B568A; Mon, 1 Oct 2018 22:38:32 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 6A3E2559A for ; Mon, 1 Oct 2018 22:38:31 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0AFDA2089D; Mon, 1 Oct 2018 16:38:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 01 Oct 2018 16:38:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=npl 3R3QrouIHtlzNuIQvtAFLukyN5wvh4k+ZWQ5n2TI=; b=H7GQ4/Xm4VZ1SrfJKru Bn4g+0Gf0NGR/p7Oo0OqyRjnJNlJd+z1of5+r6uxvlB7xWCqTYYa/eHYe/Y0de6Y E4XZ3CAsOzqvh9aMBHvnISlZ6c9y9DCOf+8hj4KlMG9k9ucBkAGAI30j8CeJbU28 1Q5yNO56TLU5eb47hCX3aFXo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=npl3R3QrouIHtlzNuIQvtAFLukyN5wvh4k+ZWQ5n2 TI=; b=YdvCqJlA5s8c95oiLUuS6LYceQbxyu9sYzvMPrcXK5HlCwIxjM/N4Gvga 2X4J/CK+8j94mKpeBgfOubeSzWWUlWdZ6/0mbk9rAorEpVe7vVSvYhmc3bjMzemI PIqneanzHNLA6md8AOaNUIQlyjTazAueN6nHAn11zMtU5uWKEY4Dvp0i8lLEPQ1D QHqTG4pdJa1jOlHBqxQlxt/uNNSNIOnbO5GUdW04t0QlUnihtC0k1cC+rKxm4AOY eEiAd9N0JBoRl1ff6XxPPo34RtQo1tqw6UWzEIZ1HG+T5rpQnsci4JP1heMCFJjT 55rZ/JWd4pUJIN1PwUbvS2byx8jbg== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 093C8102DD; Mon, 1 Oct 2018 16:38:29 -0400 (EDT) From: Thomas Monjalon To: nhorman@tuxdriver.com Cc: dev@dpdk.org Date: Mon, 1 Oct 2018 22:38:13 +0200 Message-Id: <20181001203813.1798-1-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] devtools: fix printing subject of checked patch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If checkpatches.sh is not run with verbose option (-v), the patch subject is printed as headline of errors only if there is an error reported by checkpatch.pl, not with other checks. The headline is moved to a function which is called after each check if there is an error and if it has not already be printed. One more addition, in verbose mode, checkpatch.pl is now announced as done for other checks. Signed-off-by: Thomas Monjalon Acked-by: Neil Horman --- devtools/checkpatches.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index ba795ad1d..33b48068b 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -146,14 +146,20 @@ if [ ! -f "$DPDK_CHECKPATCH_PATH" ] || [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then exit 1 fi +print_headline() { # + printf '\n### %s\n\n' "$1" + headline_printed=true +} + total=0 status=0 check () { # <patch> <commit> <title> local ret=0 + headline_printed=false total=$(($total + 1)) - ! $verbose || printf '\n### %s\n\n' "$3" + ! $verbose || print_headline "$3" if [ -n "$1" ] ; then tmpinput=$1 elif [ -n "$2" ] ; then @@ -165,9 +171,10 @@ check () { # <patch> <commit> <title> cat > "$tmpinput" fi + ! $verbose || printf 'Running checkpatch.pl:\n' report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null) if [ $? -ne 0 ] ; then - $verbose || printf '\n### %s\n\n' "$3" + $headline_printed || print_headline "$3" printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' ret=1 fi @@ -175,6 +182,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking API additions/removals:\n' report=$($VALIDATE_NEW_API "$tmpinput") if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" printf '%s\n' "$report" ret=1 fi @@ -182,6 +190,7 @@ check () { # <patch> <commit> <title> ! $verbose || printf '\nChecking forbidden tokens additions:\n' report=$(check_forbidden_additions <"$tmpinput") if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" printf '%s\n' "$report" ret=1 fi