public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sasha Levin <sashal@kernel.org>,
	dwaipayanray1@gmail.com,  lukas.bulwahn@gmail.com
Cc: mricon@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org,
	 apw@canonical.com, workflows@vger.kernel.org,
	linux-doc@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] checkpatch: add --json output mode
Date: Sun, 26 Apr 2026 02:47:50 -0700	[thread overview]
Message-ID: <01ba7d10ebbac30d1325d23ecdc8fb63c614e0d1.camel@perches.com> (raw)
In-Reply-To: <20260425200431.4088895-1-sashal@kernel.org>

On Sat, 2026-04-25 at 16:04 -0400, Sasha Levin wrote:

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -2403,6 +2426,24 @@ sub report_dump {
>  	our @report;
>  }
>  
> +sub json_print_result {
> +	my ($filename, $total_errors, $total_warnings, $total_checks,
> +	    $total_lines, $issues, $used_types, $ignored_types) = @_;
> +	my %result = (
> +		filename       => $filename,
> +		total_errors   => $total_errors,
> +		total_warnings => $total_warnings,
> +		total_checks   => $total_checks,
> +		total_lines    => $total_lines,
> +		issues         => $issues,
> +	);
> +	$result{used_types}    = $used_types    if (defined $used_types);
> +	$result{ignored_types} = $ignored_types if (defined $ignored_types);
> +	my $json_encoder = JSON::PP->new->canonical->utf8;

Maybe canonical isn't great as it outputs keys in alphabetic order.
The output may be more sensible in the defined order.

      parent reply	other threads:[~2026-04-26  9:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-06 17:00 [PATCH] checkpatch: add --json output mode Sasha Levin
2026-04-06 19:00 ` Konstantin Ryabitsev
2026-04-06 19:13   ` Sasha Levin
2026-04-06 19:22     ` Konstantin Ryabitsev
2026-04-06 20:34       ` Joe Perches
2026-04-06 20:41 ` Joe Perches
2026-04-08 17:24 ` [PATCH v2] " Sasha Levin
2026-04-08 18:16   ` Joe Perches
2026-04-25 20:04   ` [PATCH v3] " Sasha Levin
2026-04-25 21:52     ` Joe Perches
2026-04-26  0:07       ` Sasha Levin
2026-04-26  1:12         ` Joe Perches
2026-04-26 11:23           ` Sasha Levin
2026-04-26  9:47     ` Joe Perches [this message]

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=01ba7d10ebbac30d1325d23ecdc8fb63c614e0d1.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=corbet@lwn.net \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mricon@kernel.org \
    --cc=sashal@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=workflows@vger.kernel.org \
    /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