From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1801C433E0 for ; Fri, 19 Feb 2021 17:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D2E264DED for ; Fri, 19 Feb 2021 17:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbhBSR4J (ORCPT ); Fri, 19 Feb 2021 12:56:09 -0500 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:60174 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229726AbhBSR4F (ORCPT ); Fri, 19 Feb 2021 12:56:05 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 834F8100E7B47; Fri, 19 Feb 2021 17:55:23 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: food09_3c097ed2765f X-Filterd-Recvd-Size: 1969 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Fri, 19 Feb 2021 17:55:22 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 1/2] checkpatch: add verbose mode From: Joe Perches To: Dwaipayan Ray Cc: lukas.bulwahn@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Date: Fri, 19 Feb 2021 09:55:21 -0800 In-Reply-To: <20210217165434.69298-2-dwaipayanray1@gmail.com> References: <20210217165434.69298-1-dwaipayanray1@gmail.com> <20210217165434.69298-2-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-02-17 at 22:24 +0530, Dwaipayan Ray wrote: > Add a new verbose mode to checkpatch.pl to emit additional verbose > test descriptions. The verbose mode is optional and can be enabled > by the flag -v or --verbose. [] > The verbose descriptions are not shown when the --terse option > is enabled. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -2209,7 +2256,15 @@ sub report { >   splice(@lines, 1, 1); >   $output = join("\n", @lines); >   } > - $output = (split('\n', $output))[0] . "\n" if ($terse); > + > + if ($terse) { > + $output = (split('\n', $output))[0] . "\n"; > + } > + > + if ($verbose && > + exists $verbose_messages{$type}) { > + $output .= $verbose_messages{$type} . "\n\n"; > + } verbose output can be silly long if repeated multiple times. Perhaps the verbose content should only be printed once when first emitted with a flag set for that type. Something like: if ($verbose && exists($verbose_messages{$type}) && !$verbose_emitted{$type}) { $output .= ... $verbose_emitted{$type} = 1; }