Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3245109lfo; Sun, 22 May 2022 23:43:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVs3NMiptlGnmlFnVsnNWPLWNWEX/OAGvCv8N+EWrNRTII5PLfc/NKX2Ojo/DGxeYm3lcc X-Received: by 2002:a05:6a00:22d5:b0:518:806e:5829 with SMTP id f21-20020a056a0022d500b00518806e5829mr10521852pfj.54.1653288220701; Sun, 22 May 2022 23:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653288220; cv=none; d=google.com; s=arc-20160816; b=avw657fkY1+OQXxJYc3u0/vQrhzkW/jlH7ioAjVL40WAJmzC4eTAJu4agA/hF+Gyj8 kzCuRQRSs0r1jhAYVGbxhl3tNKosHIL5T+n/y1D0y7PrysmW8DSlSOBH23UrtD0E35cZ ogrustdLo+/zD5aM+2EErYduX5joInP5nxENzva7EtOiExs/2w8ieuZZdrMIX+at4MN+ cnqY13dIPwIW1Y3mv4/xy9+h1OomPn2/a+W79j2mVc340AOUbmzogxg/4WKAoPTGwVK5 wwKJS873tst+SOUpC1sAn9QclZqP+PB67qX6VoRy8aUDImX6XOQPoPFT+2did+cDrRXe 8q9Q== 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=t6MKxCzuJeGTukBo/7XIyCMAsQ6TGfQAKi12YaZfd4k=; b=ir0crgvOnU9XLXLXwvuJMVsjkVJEbFOSbSwyQrz7+fx5Ms845Z/0v32mp4U6cfBpQa H+6VEF2p4fqpfU/TJGlloo7gxmKS160VVJoo14M9APq3aH3oQ82yCRpm5MjG3+dqxEvJ VbEQ6duQa5jCjW+C7ocwwkgynHsD3APILzrM3pNLWZdoh8MD53KkCAwNJCTHUDUyLyGZ PLYZgoen8DJgbLiAn8oEHrTRET7Wm7I5GnA+MbtST7FJB7+ywXZrOWV+rJzDLnKReD/c qHY7lhMQOfhffTwnTQjpLNKk4SNUog5YacASd5KRfUg4MTKoUuNG8ARYUorz0rl5i9iG 7fTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PObf9iku; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b13-20020a170902e94d00b0015eb18d825dsi8450371pll.461.2022.05.22.23.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:43:40 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PObf9iku; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7EE58B85; Sun, 22 May 2022 23:15:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352296AbiEWCFg (ORCPT + 99 others); Sun, 22 May 2022 22:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347401AbiEWCFD (ORCPT ); Sun, 22 May 2022 22:05:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B151535DFC; Sun, 22 May 2022 19:04:10 -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 48AF760F55; Mon, 23 May 2022 02:04:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EDA3C34115; Mon, 23 May 2022 02:04:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653271449; bh=eyiR7QhydhFaI6fjx3/viaF+lXjofIW8FLX0CMh7n84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PObf9iku4A1SkAY+1Y6PPkQYRRmlNxT8eQRyLSQkgfc0ZrBo9wNNSHZBBPOgejGO1 xavn63eXk3Gxzg2RrhmrwAfc4RzHEUJgruj4giT1bIEQa6sL9+w6otQ2AQm4H7p5iw c4KErzjoBJGzHc0H2llun9Ea+l2lPRbftDSekmVpCON2ECg93qFImHjfGQgyejxa5a eySNgTXM1DZeKRZ5aNX3x031P5HjwiopYBjn4Oxu8BJFejQITSGLXIZF7P+rQF5Vwp 9ocjwZGhAq2UgtodhHOLF+oXJhGxbTBB8cPZWVD3GIJmi9dsY4uXjzxx3mS1dgFpNU UHuCh0X80PM4A== 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 v7 16/25] scripts: checkpatch: enable language-independent checks for Rust Date: Mon, 23 May 2022 04:01:29 +0200 Message-Id: <20220523020209.11810-17-ojeda@kernel.org> In-Reply-To: <20220523020209.11810-1-ojeda@kernel.org> References: <20220523020209.11810-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 457d544b0b9d..923e82467fe5 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.36.1