Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2290796imn; Mon, 1 Aug 2022 19:18:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sN+bvmRMVSBXiPsRRkAnqcubyjF3sh3Ib4WYG5J3MRQcDVlrtqzT1gHBNjx5Nul9nRzpYG X-Received: by 2002:a17:907:96a2:b0:72e:e155:1331 with SMTP id hd34-20020a17090796a200b0072ee1551331mr14877380ejc.478.1659406716907; Mon, 01 Aug 2022 19:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659406716; cv=none; d=google.com; s=arc-20160816; b=gNoaxV1jhCl6j7uMjf4PBS3jQGWYhjScGNcMPEkDhKODiusJeuqR5/PhKRrg6eroe9 F2hAJCe6/r2e1gacz5xBKbI/Wnd22P7E+S8HT4PFdXqJ35lvTtQwKWsfc2Nus5ezfZby mm+RWmPpNvblpBM9275rVsyG3cdfV9Orxp8pp0ZudF/6XEP5gNydUHbQChikL+FX2hj5 +H0zyuPQPU/Vi92d9S2fNuVYMrcJkkk5R4PGC7v0yr70vDdlDxuEPLot7qoU+pXfkDiS F+Y72Z4rTi7hfYGgKaz2OebeH8SjwF1oB7k+OJ1SSB5ySzXUl0NkRV5SpuuILsM1I+D7 drNw== 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=rmkbeiCS9YFQ6J3KAbAEK6xSQcIky2dE712HjP1j8ew=; b=qBSfjMxEgX+SmvgK6p2xzmzINOjXQE0L1oS4M0l9m0FXiK2IyvXKugVef7uZ2LAXWY TYAptvenqMPpf1lF+p5jTwJM+ZndqMYFPEyDjCq7gcqM4AqpbQmAynSoEHuZyY2UTpsI mmyDeEMWQLqMjkSjIU+/6mm5b0o2qqLeSsp1Gq44RI52WL/FqzlC+khxTUQSRsrmTDvM gaibMq/0YweyJ4fbNmXN+6OoyqPjzV1qzpKmluwY1FpQyhPnde1NpKhebvxHjL2yqTuU q4VY8Oc74E4yjmy41hE+adbRrrAgN8aQpFCqTa1xvsqhP01jwv/mzjK0qfCaOIHhTExn vPJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=krwkJpRh; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a056402328b00b0043d4a5ea78csi7043343eda.441.2022.08.01.19.18.12; Mon, 01 Aug 2022 19:18:36 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=krwkJpRh; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235778AbiHBBzK (ORCPT + 99 others); Mon, 1 Aug 2022 21:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235721AbiHBByE (ORCPT ); Mon, 1 Aug 2022 21:54:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 074404AD6D; Mon, 1 Aug 2022 18:53:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7142A61073; Tue, 2 Aug 2022 01:53:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0246CC43470; Tue, 2 Aug 2022 01:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659405191; bh=Xhoz/HriTf7Mix6x5COkG2so3swkdjDhA9Nt4WJUA3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=krwkJpRhHtM2NabndDo2nmtesgum2cCa3tXEqiD6zTuQdmhzAVvLLDGNerS2ZAHS6 J6BxY7F6v4emtF8I8YMAA/zeClyGdgA7MycJhvf2MVNLr2KugMbktpimbQC08ZxiIN 21qpB7Wv0Y3zkTagg/nNFgerOTx6MeJ/FrvPtg879YY7OZ3rznuEQRILcAfDxWyByd red/0UTTsepsinXY3K3jxssrlX7/scXw39ugz8xilGe+JA8a9zLsxtMUEdMEtK9vaT tnC/7apzRkjQ+x/CsT8B5uUK30W19xV9J/4VJoWAJ+hBXmAjFgsHDpo7ASYHqAzbmH PNN8xr3iy2IkQ== From: Miguel Ojeda To: Linus Torvalds , Greg Kroah-Hartman Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Jarkko Sakkinen , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH v8 21/31] scripts: checkpatch: enable language-independent checks for Rust Date: Tue, 2 Aug 2022 03:50:08 +0200 Message-Id: <20220802015052.10452-22-ojeda@kernel.org> In-Reply-To: <20220802015052.10452-1-ojeda@kernel.org> References: <20220802015052.10452-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Include Rust in the "source code files" category, so that the language-independent tests are checked for Rust too, and teach `checkpatch` about the comment style for Rust files. This enables the malformed SPDX check, the misplaced SPDX license tag check, the long line checks, the lines without a newline check and the embedded filename check. Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 23799e8013b3..bd0025d77bcf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3615,7 +3615,7 @@ sub process { my $comment = ""; if ($realfile =~ /\.(h|s|S)$/) { $comment = '/*'; - } elsif ($realfile =~ /\.(c|dts|dtsi)$/) { + } elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) { $comment = '//'; } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) { $comment = '#'; @@ -3663,7 +3663,7 @@ sub process { } # check we are in a valid source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); + next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/); # check for using SPDX-License-Identifier on the wrong line number if ($realline != $checklicenseline && -- 2.37.1