mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: lukas.bulwahn@gmail.com,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] checkpatch: add verbose mode
Date: Fri, 19 Feb 2021 09:55:21 -0800	[thread overview]
Message-ID: <a30afcb59bd441d90d6bba9936125c2773d830fb.camel@perches.com> (raw)
In-Reply-To: <20210217165434.69298-2-dwaipayanray1@gmail.com>

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;
	}



  reply	other threads:[~2021-02-19 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 16:54 [PATCH v4 0/2] " Dwaipayan Ray
2021-02-17 16:54 ` [PATCH v4 1/2] " Dwaipayan Ray
2021-02-19 17:55   ` Joe Perches [this message]
2021-02-17 16:54 ` [PATCH v4 2/2] docs: add documentation for checkpatch Dwaipayan Ray
2021-02-19 17:55   ` Joe Perches
2021-02-19 18:34     ` Dwaipayan Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a30afcb59bd441d90d6bba9936125c2773d830fb.camel@perches.com \
    --to=joe@perches.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®