Re: [RFC PATCH] checkpatch: correctly detect lines of help text

From: Joe Perches
Date: Wed Dec 02 2020 - 14:15:36 EST


On Wed, 2020-12-02 at 10:59 -0800, Randy Dunlap wrote:
> On 12/2/20 10:54 AM, Joe Perches wrote:
[]
> > Indentation can vary in the help blocks. For instance:
> >
> > arch/Kconfig: help
> > arch/Kconfig- Functions will have the stack-protector canary logic added in>
> > arch/Kconfig- of the following conditions:
> > arch/Kconfig-
> > arch/Kconfig- - local variable's address used as part of the right hand sid>
> > arch/Kconfig- assignment or function argument
> > arch/Kconfig- - local variable is an array (or union containing an array),
> > arch/Kconfig- regardless of array type or length
> > arch/Kconfig- - uses register local variables
> > arch/Kconfig-
> >
> > This doesn't allow blank lines for multi-paragraph help text either.
> >
> > I think keyword parsing is necessary and some false positives are
> > inevitable as the parsing logic in a line-by-line analyzer will
> > always be incomplete.
>
> 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 a wholesale conversion of Kconfig help text could be done moving
any help block not already as the last entry to be the last entry and
indenting any paragraph help text not already indented 2 extra spaces.

Should be reasonably scriptable given the parser logic available in
scripts/kconfig/.

Something akin to the scripts/parse-maintainers.pl script.