public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com,
	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 07:23:40 -0400	[thread overview]
Message-ID: <ae31vGWp-t8GiAHs@laps> (raw)
In-Reply-To: <1f8e71e117fbe7ff43723a863fd598c0568c4938.camel@perches.com>

On Sat, Apr 25, 2026 at 06:12:13PM -0700, Joe Perches wrote:
>On Sat, 2026-04-25 at 20:07 -0400, Sasha Levin wrote:
>> On Sat, Apr 25, 2026 at 02:52:35PM -0700, Joe Perches wrote:
>> On 2026-04-25 13:04, Sasha Levin wrote:
>> Add a --json flag to checkpatch.pl that emits structured JSON output,
>> > > making results machine-parseable for CI systems, IDE integrations, and
>> > > AI-assisted code review tools.
>> > []
>> > > A separate --json-pretty flag emits the same JSON in a pretty-printed
>> > > (indented, multi-line) form for human reading
>> > Why not just always use pretty?
>> > Would a script care?
>>
>> Who's the intended consumer for the --json-pretty?
>>
>> I my mind, --json is there to make it easier for tooling to process the output.
>
>Agree, but does the pretty output make it harder for tooling?

For real JSON parsers, no - they handle either form fine.
                                                                                                                                                                           
The one issue is multi-file invocations: --json emits one compact document per
file per line (NDJSON), which lets plain-shell consumers do `while read line;
do ...` or pipe through grep/awk/head. Pretty mode loses that property because
each document spans multiple lines, so consumers need a
streaming JSON parser.

-- 
Thanks,
Sasha

  reply	other threads:[~2026-04-26 11:23 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 [this message]
2026-04-26  9:47     ` Joe Perches

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=ae31vGWp-t8GiAHs@laps \
    --to=sashal@kernel.org \
    --cc=apw@canonical.com \
    --cc=corbet@lwn.net \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mricon@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