From: Joe Perches <joe@perches.com>
To: Nicolai Fischer <nicolai.fischer@fau.de>, linux-kernel@vger.kernel.org
Cc: apw@canonical.com, johannes.czekay@fau.de,
linux-kernel@i4.cs.fau.de, akpm@linux-foundation.org
Subject: Re: [PATCH v2 3/4] checkpatch: kconfig: enforce help text indentation
Date: Sat, 26 Dec 2020 07:50:04 -0800 [thread overview]
Message-ID: <c746437027a6aae481a8719be929970b33a67d2d.camel@perches.com> (raw)
In-Reply-To: <20201226140511.662368-4-nicolai.fischer@fau.de>
On Sat, 2020-12-26 at 15:05 +0100, Nicolai Fischer wrote:
> Adds a new warning in case the indentation level of the
> first line of a Kconfig help message is not two spaces
> higher than the keyword itself.
> Blank lines between the message and the help keyword
> are ignored.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3332,6 +3336,13 @@ sub process {
> $f =~ s/^\s+//;
> next if ($f =~ /^$/);
>
>
> + if (defined $help_indent) {
> + if ($lines[$ln - 1] !~ /^\+$help_indent\ {2}\S*/) {
> + $help_stat_real = get_stat_real($ln - 1, $ln);
> + }
> + undef $help_indent;
> + }
This doesn't work if the indent is more than 2 spaces.
$ cat Kconfigtest
menuconfig FOO
bool "Enable foo" if EXPERT
default y
help
Line 1.
Line 2.
Line 3.
Line 4.
$ ./scripts/checkpatch.pl -f Kconfigtest
total: 0 errors, 0 warnings, 10 lines checked
Kconfigtest has no obvious style problems and is ready for submission.
Also, it may be useful to test that the indent after a block
uses a single tab more than the block start.
Look at the first block of block/Kconfig:
The indentation of bool and help uses 7 spaces but the indentation
of the help text uses a tab then 1 space.
It'd be useful to emit a warning for that.
menuconfig BLOCK
bool "Enable the block layer" if EXPERT
default y
select SBITMAP
select SRCU
help
Provide block layer support for the kernel.
Disable this option to remove the block layer support from the
kernel. This may be useful for embedded devices.
If this option is disabled:
- block device files will become unusable
- some filesystems (such as ext3) will become unavailable.
Also, SCSI character devices and USB storage will be disabled since
they make use of various block layer definitions and facilities.
Say Y here unless you know you really don't want to mount disks and
suchlike.
next prev parent reply other threads:[~2020-12-26 15:51 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 [this message]
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
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=c746437027a6aae481a8719be929970b33a67d2d.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=johannes.czekay@fau.de \
--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
all inboxes | Powered by JetHome®