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=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham 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 014FAC433DB for ; Mon, 21 Dec 2020 17:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0FC922CA1 for ; Mon, 21 Dec 2020 17:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726408AbgLURSh (ORCPT ); Mon, 21 Dec 2020 12:18:37 -0500 Received: from smtprelay0196.hostedemail.com ([216.40.44.196]:56252 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725930AbgLURSg (ORCPT ); Mon, 21 Dec 2020 12:18:36 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 3995118037D2A; Mon, 21 Dec 2020 17:17:55 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: tray82_421167e27459 X-Filterd-Recvd-Size: 2771 Received: from XPS-9350.home (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Mon, 21 Dec 2020 17:17:53 +0000 (UTC) Message-ID: Subject: Re: [PATCH 2/2] checkpatch: kconfig: add missing types to regex From: Joe Perches To: Nicolai Fischer , linux-kernel@vger.kernel.org Cc: apw@canonical.com, johannes.czekay@fau.de, linux-kernel@i4.cs.fau.de Date: Mon, 21 Dec 2020 09:17:52 -0800 In-Reply-To: <5d7cef4f-071d-0504-74df-bd944a11dd70@fau.de> References: <1f3b50a6f343dd252c043b2e5b7d47bca8514ee7.camel@perches.com> <5d7cef4f-071d-0504-74df-bd944a11dd70@fau.de> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-12-21 at 16:08 +0100, Nicolai Fischer wrote: > On Sun, 2020-12-20 at 20:16 +0100, Joe Perches wrote: > > On Mon, 2020-12-14 at 11:24 +0100, Nicolai Fischer wrote: > > > Kconfig parsing does not recognise all type attributes. > > > This adds the missing 'int', 'sting' and 'hex' types. > > [] > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > [] > > > @@ -3321,7 +3321,7 @@ sub process { > > >   next if ($f =~ /^-/); > > >   last if (!$file && $f =~ /^\@\@/); > > >   > > > > > > - if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { > > > + if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|int|hex|string|prompt)\s*["']/) { > > >   $is_start = 1; > > >   } elsif ($lines[$ln - 1] =~ /^\+\s*help$/) { > > >   $length = -1; > > > > Another thing that could be done is to enforce the "extra 2 spaces" > > indent by capturing the whitespace before the help keyword: > > > > } elsif ($lines[$ln - 1] =~ /^\+\s*help$/) { > > > > could be > > > > } elsif ($lines[$ln - 1] =~ /^\+(\s*)help\s*$/) { > > > > with $1 used to validate the extra indent. > > > > > > > In case the indent does not match, should we display a new warning as in our previous patch? Sure, but in a separate patch and ensure blank lines are ignored. + if ($l !~ /^\ {2}/) { + $wrong_indent = 1; } The message you used: + WARN("CONFIG_DESCRIPTION", + "help text is not indented 2 spaces more than the help keyword\n" . $herecurr); is IMO a bit oddly phrased and could/should test only the first line after the help keyword and show the help line using $hereprev.