From: Nicolai Fischer <nicolai.fischer@fau.de>
To: Joe Perches <joe@perches.com>, linux-kernel@vger.kernel.org
Cc: apw@canonical.com, akpm@linux-foundation.org,
johannes.czekay@fau.de, linux-kernel@i4.cs.fau.de
Subject: Re: [PATCH v3 3/5] checkpatch: kconfig: enforce help text indentation
Date: Tue, 5 Jan 2021 16:49:02 +0100 [thread overview]
Message-ID: <13db326d-0f63-402e-b475-8f3b2ceece13@fau.de> (raw)
In-Reply-To: <5f01770454d163605406265b1bf316e0452753cf.camel@perches.com>
On Tue 05.01.21 09:57, Joe Perches wrote:
> On Mon, 2021-01-04 at 14:09 -0800, Joe Perches wrote:
>> On Sun, 2021-01-03 at 08:50 +0100, Nicolai Fischer wrote:
>>> Adds a new warning in case the indentation level of the
>>> first line of a Kconfig help message is not at least two spaces
>>> higher than the keyword itself.
>>> Blank lines between the message and the help keyword
>>> are ignored.
>>>
>>> Co-developed-by: Johannes Czekay <johannes.czekay@fau.de>
>>> Signed-off-by: Johannes Czekay <johannes.czekay@fau.de>
>>> Signed-off-by: Nicolai Fischer <nicolai.fischer@fau.de>
>>> ---
>>>
>>> Now matches indentation of two or more spaces, instead of exactly two.
>>
>> No, this should match exactly 2 and warn on any other use.
>
> To clarify, only the first line after the help keyword needs to
> have a 2 space indent more than the help keyword and the help
> block may start with Kconfig keywords.
>> Subsequent help block lines may have more than 2 chars.
Okay, thank you for the clarification.
>
> The help block line count should end when the indent is less than
> the help keyword indent and is a non-blank line.
We could do something like this
if (defined $help_indent) {
$lines[$ln - 1] =~ /^\+(\s*)\S+/;
if (length($1) < length($help_indent)) {
is_end = 1; last;
}
as an extra patch after patch 3.
Please clarify whether we should match for a smaller indent than the help
keyword or the first non-blank line after the keyword.
>
> This should be valid:
>
> help
> line 1
> -- reason 1
> -- reason 2
> continuation
> -- reason 3
>
> But this should warn only on line 1:
>
> help
> line 1 has a 3 space indent
> -- reason 1
> -- reason 2
> continuation
> -- reason 3
>
>
next prev parent reply other threads:[~2021-01-05 15:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-14 10:22 [PATCH 0/2] checkpatch: update kconfig parsing Nicolai Fischer
2020-12-26 14:05 ` [PATCH v2 0/4] " Nicolai Fischer
2020-12-26 14:05 ` [PATCH v2 1/4] checkpatch: kconfig: replace '---help---' with 'help' Nicolai Fischer
2020-12-26 14:05 ` [PATCH v2 2/4] checkpatch: kconfig: add missing types to regex Nicolai Fischer
2020-12-26 14:05 ` [PATCH v2 3/4] checkpatch: kconfig: enforce help text indentation Nicolai Fischer
2020-12-26 15:50 ` Joe Perches
2020-12-26 14:05 ` [PATCH v2 4/4] checkpatch: kconfig: clarify warning for paragraph length Nicolai Fischer
2021-01-03 7:50 ` [PATCH v3 0/5] update kconfig parsing Nicolai Fischer
2021-01-03 7:50 ` [PATCH v3 1/5] checkpatch: kconfig: replace '---help---' with 'help' Nicolai Fischer
2021-01-03 7:50 ` [PATCH v3 2/5] checkpatch: kconfig: add missing types to regex Nicolai Fischer
2021-01-03 7:50 ` [PATCH v3 3/5] checkpatch: kconfig: enforce help text indentation Nicolai Fischer
2021-01-04 22:09 ` Joe Perches
2021-01-05 8:57 ` Joe Perches
2021-01-05 15:49 ` Nicolai Fischer [this message]
2021-01-03 7:50 ` [PATCH v3 4/5] checkpatch: kconfig: clarify warning for paragraph length Nicolai Fischer
2021-01-03 7:50 ` [PATCH v3 5/5] checkpatch: kconfig: enforce block indentation Nicolai Fischer
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=13db326d-0f63-402e-b475-8f3b2ceece13@fau.de \
--to=nicolai.fischer@fau.de \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=joe@perches.com \
--cc=johannes.czekay@fau.de \
--cc=linux-kernel@i4.cs.fau.de \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®