From: Randy Dunlap <rdunlap@infradead.org>
To: Joe Perches <joe@perches.com>,
Nicolai Fischer <nicolai.fischer@fau.de>,
linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Cc: apw@canonical.com, johannes.czekay@fau.de,
linux-kernel@i4.cs.fau.de,
linux-kernel-mentees@lists.linuxfoundation.org,
kernel-janitors <kernel-janitors@vger.kernel.org>
Subject: Re: [RFC PATCH] checkpatch: correctly detect lines of help text
Date: Thu, 3 Dec 2020 11:07:04 -0800 [thread overview]
Message-ID: <35b5a3fd-7b15-1173-b64a-b20839706527@infradead.org> (raw)
In-Reply-To: <40543766190a1d5e054e6573ae00112467acf964.camel@perches.com>
On 12/3/20 11:04 AM, Joe Perches wrote:
> On Thu, 2020-12-03 at 10:31 -0800, Randy Dunlap wrote:
>> On 12/3/20 9:58 AM, Joe Perches wrote:
>>> On Wed, 2020-12-02 at 10:59 -0800, Randy Dunlap wrote:
>>>
>>>> There are also large hunks of block/Kconfig and drivers/hid/Kconfig
>>>> that don't use any indentation for help text...
>>>> in case that matters here.
>>>
>>> Maybe something like this could help.
>>>
>>> Indent the unindented help blocks by 2 spaces and reflow where appropriate.
>>>
>>> ---
>>> block/Kconfig | 105 +++++-----
>>> drivers/hid/Kconfig | 549 +++++++++++++++++++++++++++-------------------------
>>> 2 files changed, 335 insertions(+), 319 deletions(-)
>>
>>
>> LGTM. Thanks.
>
> btw: there appears to be ~750 help sections in Kconfig files
> that do not use 2 space indentation for the help content vs
> the ~14000 help sections that do use 2 space indentation.
>
> Maybe there's some value in standardizing on the 2 space style.
coding-style.rst implies to mean that we have already done that:
For all of the Kconfig* configuration files throughout the source tree,
the indentation is somewhat different. Lines under a ``config`` definition
are indented with one tab, while help text is indented an additional two
spaces.
>
> A trivial script to show the sections that don't use 2 spaces:
>
> $ git grep -n -A1 -P "^\s*help\s*$" -- '*/Kconfig*' |
> grep -v '^--$' |
> perl -e 'while (<>) {
> my $line1 = $_;
> my $line2 = <>;
>
> my $l1 = $line1;
> my $l2 = $line2;
>
> chomp($l1);
> chomp($l2);
>
> $l1 =~ s/^.*:\d+:(\s*).*/$1/;
> $l2 =~ s/^.*-\d+-(\s*).*/$1/;
>
> if ("$l1 " ne "$l2") {
> print "$line1";
> print "$line2";
> }
> }'
>
> Change the ne to eq to see the matches.
>
> For instance, a head -50 of the above is:
>
[snip]
thanks.
--
~Randy
prev parent reply other threads:[~2020-12-03 19:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-02 18:27 [RFC PATCH] checkpatch: correctly detect lines of help text Nicolai Fischer
2020-12-02 18:54 ` Joe Perches
2020-12-02 18:59 ` Randy Dunlap
2020-12-02 19:14 ` Joe Perches
2020-12-03 17:58 ` Joe Perches
2020-12-03 18:31 ` Randy Dunlap
2020-12-03 19:04 ` Joe Perches
2020-12-03 19:07 ` Randy Dunlap [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=35b5a3fd-7b15-1173-b64a-b20839706527@infradead.org \
--to=rdunlap@infradead.org \
--cc=ak@linux.intel.com \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=johannes.czekay@fau.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@i4.cs.fau.de \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolai.fischer@fau.de \
/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;
as well as URLs for NNTP newsgroup(s).