[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a30afcb59bd441d90d6bba9936125c2773d830fb.camel@perches.com>
Date: Fri, 19 Feb 2021 09:55:21 -0800
From: Joe Perches <joe@...ches.com>
To: Dwaipayan Ray <dwaipayanray1@...il.com>
Cc: lukas.bulwahn@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/2] checkpatch: add verbose mode
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;
}
Powered by blists - more mailing lists