Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5849936rwb; Wed, 7 Sep 2022 08:50:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR71UpkWES6RlTv93G3fBRc7/uiAqbKUDeur0uOIoMGvG2gfF9P187fnhCx2lVSwrO+OgtL4 X-Received: by 2002:a17:902:8ecc:b0:174:3c10:542b with SMTP id x12-20020a1709028ecc00b001743c10542bmr4574268plo.91.1662565829957; Wed, 07 Sep 2022 08:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662565829; cv=none; d=google.com; s=arc-20160816; b=aVT8FwfnmJmMFlon8AhR7cYKa+lhR+YOxuiCea7yZQC/sQarWmvljQtsfcmUl48Ysk QzUOztaIHpPJjQqiutglJZN4xjdxpplXUG4fHjC54oivdHWvFj/zLko+VfqWuiDhMpGm U9mdLifsdzofwvH+guNQ/np8FUFyiWJGj3LtXIyuxwVORcWsuNoPY/Yy333PL8Y7F9yX xysfDXYgMzPc5u5zvVeH98HPXQmBM+L2PdYCNTfa9GGK7Hp7f5/GzCu6ffFKWZzY9PZm AwrFDd/EpgFDYMAzW14sFT6anr+35uV/NsRZULLaArfmFpMkXdXVqjJ8un168z5rGTnO JPAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=+UZ307qnsU08edsXm6l+8RW0HuDwx0rQsrcQfyqPghI=; b=ZAEzVSTV9R6d99JxcXtGcsNzursaU+ey68is/wzMmSTj1wh0zUe8vpVOsARkQCxGDu HkHQNZMW1VJRXN9RehddLattMYPki5XVhQsIUw5q+fgnyheFnH9Ks7RJwmS6htFZyLQm WFsUEiT5RHox8X3Nqs9C0p21rmZDPFBLkzZiD9kg4Qjzc1wtEUWhg+eE8HKCjEZTS1jb g3VHtPE4sqH/qS1ZhRiai4f2wk2+Fcixa8KhfMsRkmUWGT0dvnsrCq+A57eiutbc2bWs ViZaclya7ZhsBpheUlm4R8S524DaWZg1cPPcgEICrAHYoYAIkw2LGYJQS1iQ5PoaPzUK 1ivQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s14-20020a170902ea0e00b0016ce3d67e7csi18054784plg.387.2022.09.07.08.50.17; Wed, 07 Sep 2022 08:50:29 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbiIGPSp convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Sep 2022 11:18:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbiIGPSi (ORCPT ); Wed, 7 Sep 2022 11:18:38 -0400 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E93E371BF6 for ; Wed, 7 Sep 2022 08:18:35 -0700 (PDT) Received: from omf20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 60C411C68A7; Wed, 7 Sep 2022 15:18:34 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA id D326820028; Wed, 7 Sep 2022 15:18:32 +0000 (UTC) Message-ID: <1125e8a68a709e18b594f74fc9b25b9992b1582f.camel@perches.com> Subject: Re: [PATCH] checkpatch: add check for fixes: tag From: Joe Perches To: Philippe Schenker , Andy Whitcroft , linux-kernel@vger.kernel.org Cc: Stephen Rothwell , Dwaipayan Ray , Lukas Bulwahn , Shawn Guo , Philippe Schenker Date: Wed, 07 Sep 2022 08:18:31 -0700 In-Reply-To: <20220907123547.138646-1-dev@pschenker.ch> References: <20220907123547.138646-1-dev@pschenker.ch> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Rspamd-Queue-Id: D326820028 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: zdys8kds7bey5hp9ft4grgzadyasbyf9 X-Rspamd-Server: rspamout02 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+zyQf/rXFLnDazr9jzGp0+Aw/rk4VExtE= X-HE-Tag: 1662563912-10451 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 On Wed, 2022-09-07 at 14:35 +0200, Philippe Schenker wrote: > From: Philippe Schenker > > The page about submitting patches in > Documentation/process/submitting-patches.rst is very specific on how that > tag should be formatted: 'Fixes: <12+ chars of sha1> (\"\")' > > Add a rule that warns if this format does not match. This commit is > introduced as in the past commits have been sent multiple times with > having the word commit also in the Fixes: tag which had to be corrected > by the maintainers. [1] I preferred your first patch that added the commit description match as that's a fairly common defect. > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3438,6 +3438,13 @@ sub process { > } > } > > +# Check fixes tag format > + if ($in_commit_log && ($line =~ /^\s*Fixes:/i) && > + !($line =~ /^\s*Fixes:\s[0-9a-f]{12,40}\s\(\".*\"\)/)) { All fixes lines should start in the first column. This allows spaces at the start of the line and the only white space allowed after Fixes: and after the SHA1 should be a space not a tab. I think the test better if it checks for a SHA1 after fixes. And IMO !(foo =~ /bar.../) is better written as foo !~ /bar.../ so if ($in_commit_log && $line =~ /^\s*Fixes:?\s*[0-9a-f]{5,}\b/i && $line !~ /^Fixes: [0-9a-f]{12,40} \(\".*\"\)/)) { Though it's arguable that the SHA1 should _only_ be length 12 and not longer.