Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1852810rwb; Fri, 5 Aug 2022 08:51:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IkbZl1kXPXIvffcjFpt3B159uvMAHPpEad9do82iwiqfOO1qtMhFndiKbKhd4ZjOqRC1S X-Received: by 2002:a17:902:8647:b0:16c:e60e:570a with SMTP id y7-20020a170902864700b0016ce60e570amr7109985plt.77.1659714665129; Fri, 05 Aug 2022 08:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659714665; cv=none; d=google.com; s=arc-20160816; b=x50E5gosxWn+QAWHzTuUdxl2s5JzEJ+JezfngJgveAZecnVUytRxXaWaFR3c2o2brd 9DUN/8IRthI/zJcMr8O9U/VCRx4E3cqJqP7Vq958Syb10OLkW0A6izgX0pRkzqGhPQt3 sxNXCdyQ9BWoNgzQ2wmGecjmGWRMFrw8XQu/6LaDEfF1fxGhYyTITb68l0tglxncJHGi int/XxONKq5Qn3bf+9QKZ5rbY8iKlpRBy94pRNyEf1t6oQJ2X8mjDCC/hZZzvgtazcwm w06+BnL1xUtHy8ppXsi6ac3ShnfnGSwJ4dQ60nIOEP0GkBXJ7OGO4qqd4YQw4qHH9QMZ zl2w== 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=KlDPMoaB1ttDFCnUgCIj2/Wk7SvYmCXERECGWA04nY/nUO//7o3M0VMBSUkEMAKp6j 3cen0E8dl4NXQm2W9qz0WJ0eSgF7mEH4IuOFJXxhQlxxSVgV5zKUy/gOXMKyE1/jfJN4 6nhS7JjeSpndxN/WYI0iXYoNs61trmA3CyLqDSjzY+x3S84cTeUjq1VKKGqakNMeGMZw 2do8gA+SHMQogljGvtzDavrIutxydxWjXratdtIFVXfzv9qUEkbTKA7imPr9DXEqQM/h /OiVWfUFzn+IKOpIZUCcpeDiFUue82PxVNvgV6QrIvQ5CH+XLOQdDjY/tIoYKOsTtldH NFfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vh1PYV+B; 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 h7-20020a631207000000b0041b67157cf1si3383239pgl.365.2022.08.05.08.50.49; Fri, 05 Aug 2022 08:51:05 -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=Vh1PYV+B; 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 S241369AbiHEPrs (ORCPT + 99 others); Fri, 5 Aug 2022 11:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241049AbiHEPpd (ORCPT ); Fri, 5 Aug 2022 11:45:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C056C72ECC; Fri, 5 Aug 2022 08:44:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6C999B82984; Fri, 5 Aug 2022 15:44:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05858C433D6; Fri, 5 Aug 2022 15:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659714246; bh=Xhoz/HriTf7Mix6x5COkG2so3swkdjDhA9Nt4WJUA3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vh1PYV+BmSsfMGJFm8XrKX7aQ9EWEC4qYH/Kj5zX9KSwTpdcTXBbUDTpKNhvUgSrF pDyTwsrtd4Ior5+1Z2AwGAeHYC0BOl3NsS+lptJdYhyaH7Ncsf7olf5u0dlA1IqiyR GtEk0D8DDS4OuKSmdBwFOtBm67aQp83XHarxnXwx26Y5LHcWo5nHnnDsUHsTFeC2Fh fD7dHKDhl9yEbcwKKQDrF/aGFVSpwyuDtR34aKWtgFv9Dv1WyXdjNC4rE5Th7UJa1a zVjSrUBS06QDqPkPk+isGHY9pWML3hFMFZ5ABmb0GwoXi8+8aoui0jFzIWbOcnEgzq hSvGST46e/uYA== From: Miguel Ojeda To: Linus Torvalds , Greg Kroah-Hartman Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH v9 16/27] scripts: checkpatch: enable language-independent checks for Rust Date: Fri, 5 Aug 2022 17:42:01 +0200 Message-Id: <20220805154231.31257-17-ojeda@kernel.org> In-Reply-To: <20220805154231.31257-1-ojeda@kernel.org> References: <20220805154231.31257-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,T_SCC_BODY_TEXT_LINE 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