From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEDCFC64E7C for ; Wed, 2 Dec 2020 19:15:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5719020DD4 for ; Wed, 2 Dec 2020 19:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728260AbgLBTPd (ORCPT ); Wed, 2 Dec 2020 14:15:33 -0500 Received: from smtprelay0007.hostedemail.com ([216.40.44.7]:55188 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726213AbgLBTPd (ORCPT ); Wed, 2 Dec 2020 14:15:33 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 3D95518224D6B; Wed, 2 Dec 2020 19:14:52 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: map52_230a82a273b5 X-Filterd-Recvd-Size: 2515 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Wed, 2 Dec 2020 19:14:50 +0000 (UTC) Message-ID: Subject: Re: [RFC PATCH] checkpatch: correctly detect lines of help text From: Joe Perches To: Randy Dunlap , Nicolai Fischer , linux-kernel@vger.kernel.org, Andi Kleen Cc: apw@canonical.com, johannes.czekay@fau.de, linux-kernel@i4.cs.fau.de Date: Wed, 02 Dec 2020 11:14:49 -0800 In-Reply-To: <16f0bfd4-61ca-48d8-c9ab-10bfc9a233ad@infradead.org> References: <133ac827-c0d2-c5c7-39d8-7d2c17de7c76@fau.de> <8436bc4191d92af283ea6aa7ca450e36da653e2e.camel@perches.com> <16f0bfd4-61ca-48d8-c9ab-10bfc9a233ad@infradead.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.