On Mon, 2021-01-04 at 13:12 -0800, akpm@xxxxxxxxxxxxxxxxxxxx wrote: > The patch titled > Subject: checkpatch: kconfig: enforce help text indentation > has been added to the -mm tree. Its filename is > checkpatch-kconfig-enforce-help-text-indentation.patch > > This patch should soon appear at > https://ozlabs.org/~akpm/mmots/broken-out/checkpatch-kconfig-enforce-help-text-indentation.patch > and later at > https://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-kconfig-enforce-help-text-indentation.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days Andrew: I think you should wait to apply these until I ack/nak them. Nak. This still doesn't work to validate 2 space only indentation. > > ------------------------------------------------------ > From: Nicolai Fischer <nicolai.fischer@xxxxxx> > Subject: checkpatch: kconfig: enforce help text indentation > > 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. Not at least. This should test for exactly 2. > Blank lines between the message and the help keyword > are ignored. And if it's non-blank and < the help indent, the help block content test should be terminated. > > Link: https://lkml.kernel.org/r/20210103075015.23946-4-nicolai.fischer@xxxxxx > Co-developed-by: Johannes Czekay <johannes.czekay@xxxxxx> > Signed-off-by: Johannes Czekay <johannes.czekay@xxxxxx> > Signed-off-by: Nicolai Fischer <nicolai.fischer@xxxxxx> > Cc: Joe Perches <joe@xxxxxxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > --- > > scripts/checkpatch.pl | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > --- a/scripts/checkpatch.pl~checkpatch-kconfig-enforce-help-text-indentation > +++ a/scripts/checkpatch.pl > @@ -3313,6 +3313,8 @@ sub process { > my $f; > my $is_start = 0; > my $is_end = 0; > + my $help_indent; > + my $help_stat_real; > for (; $cnt > 0 && defined $lines[$ln - 1]; $ln++) { > $f = $lines[$ln - 1]; > $cnt-- if ($lines[$ln - 1] !~ /^-/); > @@ -3323,8 +3325,10 @@ sub process { > > > if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|int|hex|string|prompt)\s*(?:["'].*)?$/) { > $is_start = 1; > - } elsif ($lines[$ln - 1] =~ /^\+\s*help$/) { > - $length = -1; > + } elsif ($lines[$ln - 1] =~ /^\+(\s*)help$/) { > + $help_indent = $1; > + $length = 0; > + next; > } > > > $f =~ s/^.//; > @@ -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 only checks context lines in the patch > # and so hopefully shouldn't trigger false > # positives, even though some of these are > @@ -3347,6 +3358,10 @@ sub process { > WARN("CONFIG_DESCRIPTION", > "please write a paragraph that describes the config symbol fully\n" . $herecurr); > } > + if ($is_start && $is_end && defined $help_stat_real) { > + WARN("CONFIG_DESCRIPTION", > + "please indent the help text two spaces more than the keyword\n" . "$here\n$help_stat_real\n"); > + } > #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; > } > > > _ > > Patches currently in -mm which might be from nicolai.fischer@xxxxxx are > > checkpatch-kconfig-replace-help-with-help.patch > checkpatch-kconfig-add-missing-types-to-regex.patch > checkpatch-kconfig-enforce-help-text-indentation.patch > checkpatch-kconfig-clarify-warning-for-paragraph-length.patch > checkpatch-kconfig-enforce-block-indentation.patch >