From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id E830A4C9D for ; Mon, 1 Oct 2018 22:48:55 +0200 (CEST) Received: from cpe-2606-a000-111b-40fe-f1c6-eb46-ccca-fca5.dyn6.twc.com ([2606:a000:111b:40fe:f1c6:eb46:ccca:fca5] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1g757Q-0007vt-Vq; Mon, 01 Oct 2018 16:48:53 -0400 Date: Mon, 1 Oct 2018 16:48:08 -0400 From: Neil Horman To: Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20181001204808.GA12992@hmswarspite.think-freely.org> References: <20181001203813.1798-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181001203813.1798-1-thomas@monjalon.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [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: , X-List-Received-Date: Mon, 01 Oct 2018 20:48:56 -0000 On Mon, Oct 01, 2018 at 10:38:13PM +0200, Thomas Monjalon wrote: > 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 > -- > 2.19.0 > >