From patchwork Wed Nov 23 01:12:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Elliott, Robert (Servers)" X-Patchwork-Id: 24648 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2528881wrr; Tue, 22 Nov 2022 17:16:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GJmVaLHaFH7dCZhY778Ll7hCsDwWaqvHr9wZ0ZYfGQIgiyquOnvAdjd3Noo7PdPW8WFnf X-Received: by 2002:a17:906:b28f:b0:7ad:a942:4d6b with SMTP id q15-20020a170906b28f00b007ada9424d6bmr21302928ejz.379.1669166208833; Tue, 22 Nov 2022 17:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669166208; cv=none; d=google.com; s=arc-20160816; b=A/IDl4eGExjhmG0AKIMqQfvYV+oWT9cr+SlvFNoGdOnRxmLFDjKHwqVmsgxEfmUhJr OeTyBS1hG7QwepZT/yqTTDfZ1lhXdGU3IBIexlElRkADpA28C07OyN53LJm4lBEUv/u6 ybiI/mk7mgzqPkihyb+tqyGNZ5WvXtk6o852dkfevIzBBFSvR4R79WtaAXNl6HvBLhzZ VrNC6jpiDLaeNj2z6USGUOp6eskMoE4aH5FpOpzFr5xKNA22lUGT8FrhQON0oryKanli pQtcxOLJMtAEX4Je+d3Ikh5RgLRrWyhfvHfhkL8gJSd3n40XcLmWgyr110ijPGbhiZK7 LiZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ukwxXPbGmLCn1spwphTBIES8Kmvp/s1JITBBYWi1oWM=; b=rTbAaGjBjzX29smWh/3pCcy/B1uaH1rPKEUOun+PGwU00SPOLc9Y4CP3/8+NRhjoCc iCcUNF1cEg1b8aUiYAkFgFanwKczM6TCku1ZehI6YKdiTARw+pNrnLKWYdwqwYOfQeCn LVrA6MVEBq/e/6D8I1w6JBr6bDhroh2BsLC2cjI5L5iXbAqkgE9ZV+93GyksBgvNxij0 ySe1XexUH0Vvm1LMiQ21KaaUHlXImuostZC0jxqZN2KPV7MaktqpSI7gGcyTZqijLWm8 o53Eem37U6GQqPt8I86/7pKZMNpy3ZTu7kE/ynBih7aBGo1aWilB79ysZ/0X4ZKiix3q Xsig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=JM7lzIet; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056402279400b00457e6752422si5953739ede.189.2022.11.22.17.16.24; Tue, 22 Nov 2022 17:16:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=JM7lzIet; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235126AbiKWBOE (ORCPT + 99 others); Tue, 22 Nov 2022 20:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235555AbiKWBNh (ORCPT ); Tue, 22 Nov 2022 20:13:37 -0500 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FC64E0AA for ; Tue, 22 Nov 2022 17:12:28 -0800 (PST) Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AMNhDkp003319; Wed, 23 Nov 2022 01:12:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=ukwxXPbGmLCn1spwphTBIES8Kmvp/s1JITBBYWi1oWM=; b=JM7lzIetQRcwBkmLMXXVKf7U7TqSEA2VZ7GxjorYSPpTB/tgaeAgTHSHwQ/4mDdb2lzl j+bigHyRb7mf43eRbrCxAx5diVukLNWcaL1EnmVIzLFq+o/TugdT43FyIFo8Si9Cewlb GYMk7ZgH4Tf5YeBfgZvzjqG0FPZRfoVE5qpur/k4b68AEuGJsmLmD/mgEzDh9lcYOKZ/ 0+vXcn7czYYzipkyyCGSDqgPOzUhQuj3ej4CmO0twvNszJm/w4ORorrwQw1lpHz4OUUi 2+kq+uCwOHsVbFuJqmdpG2vmaMqfKuH9bzIMQ2V2ImSHGkWz84VhQU8zFlHzSCKXUGq/ bg== Received: from p1lg14878.it.hpe.com (p1lg14878.it.hpe.com [16.230.97.204]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3m100tcu9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 01:12:22 +0000 Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id A30952EECF; Wed, 23 Nov 2022 01:12:21 +0000 (UTC) Received: from adevxp033-sys.us.rdlabs.hpecorp.net (unknown [16.231.227.36]) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTP id 5BC0E8005C6; Wed, 23 Nov 2022 01:12:21 +0000 (UTC) From: Robert Elliott To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com Cc: linux-kernel@vger.kernel.org, Robert Elliott Subject: [PATCH v2 3/5] checkpatch: check line length in Kconfig help text Date: Tue, 22 Nov 2022 19:12:00 -0600 Message-Id: <20221123011202.939319-4-elliott@hpe.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123011202.939319-1-elliott@hpe.com> References: <20220815041548.43744-1-elliott@hpe.com> <20221123011202.939319-1-elliott@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: ex98Q3_cjLyTg2i0s1b7KCjL5a6M5tm9 X-Proofpoint-GUID: ex98Q3_cjLyTg2i0s1b7KCjL5a6M5tm9 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 adultscore=0 suspectscore=0 spamscore=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230007 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750247626317488587?= X-GMAIL-MSGID: =?utf-8?q?1750247626317488587?= Apply the normal --max-line-length=nn line length checks to Kconfig help text. The default of 100 is only triggered by one existing line in a file named Kconfig. Running with --max-line-length=80 reports only a few long lines: - 11 between 90 and 99 characters - 25 betwen 81 and 89 characters 9 of which are due to long URLs. Signed-off-by: Robert Elliott --- scripts/checkpatch.pl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c907d5cf0ac8..1b7a98adcaeb 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3496,7 +3496,7 @@ sub process { next if ($f =~ /^-/); last if ($f !~ /^[\+ ]/); # !patch context - if ($f =~ /^[\+ ]\s*(?:bool|tristate|prompt)\s*["']/) { + if ($f =~ /^[\+ ]\s*(?:bool|tristate|string|hex|int|prompt)\s*["']/) { $needs_help = 1; next; } @@ -3515,12 +3515,27 @@ sub process { # and so hopefully shouldn't trigger false # positives, even though some of these are # common words in help texts - if ($f =~ /^(?:config|menuconfig|choice|endchoice| - if|endif|menu|endmenu|source)\b/x) { + if ($f =~ /^(?:config|menuconfig| + choice|endchoice| + comment|if|endif| + menu|endmenu|source)\b/x) { last; } + + # no further checking for lines with these keywords + if ($f =~ /^(?:default|def_bool|depends|select|imply)\b/x) { + next; + } + + my ($length, $indent) = line_stats($f); + if ($length > $max_line_length) { + WARN("CONFIG_DESCRIPTION", + "Kconfig help text line length ($length) too long: $f\n"); + } + $help_length++ if ($has_help); } + if ($needs_help && $help_length < $min_conf_desc_length) { my $stat_real = get_stat_real($linenr, $ln - 1);