lkml.org 
[lkml]   [2021]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 1/2] checkpatch: add verbose mode
From
Date
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;
}


\
 
 \ /
  Last update: 2021-02-19 18:58    [W:0.056 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site