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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 C5FFFC433E0 for ; Sat, 26 Dec 2020 15:51:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84D0A20855 for ; Sat, 26 Dec 2020 15:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726221AbgLZPut (ORCPT ); Sat, 26 Dec 2020 10:50:49 -0500 Received: from smtprelay0227.hostedemail.com ([216.40.44.227]:52166 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725995AbgLZPus (ORCPT ); Sat, 26 Dec 2020 10:50:48 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 486F4180A7FF1; Sat, 26 Dec 2020 15:50:07 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: self21_070e6ca27483 X-Filterd-Recvd-Size: 2984 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Sat, 26 Dec 2020 15:50:06 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 3/4] checkpatch: kconfig: enforce help text indentation 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, akpm@linux-foundation.org Date: Sat, 26 Dec 2020 07:50:04 -0800 In-Reply-To: <20201226140511.662368-4-nicolai.fischer@fau.de> References: <20201226140511.662368-1-nicolai.fischer@fau.de> <20201226140511.662368-4-nicolai.fischer@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 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.