From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DF66C388F7 for ; Sat, 7 Nov 2020 05:09:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B89520872 for ; Sat, 7 Nov 2020 05:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbgKGFJo (ORCPT ); Sat, 7 Nov 2020 00:09:44 -0500 Received: from smtprelay0058.hostedemail.com ([216.40.44.58]:50470 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726320AbgKGFJo (ORCPT ); Sat, 7 Nov 2020 00:09:44 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id D0EC1182CED28; Sat, 7 Nov 2020 05:09:42 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: card60_151077e272d8 X-Filterd-Recvd-Size: 3142 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Sat, 7 Nov 2020 05:09:41 +0000 (UTC) Message-ID: <8c642098bbbc92e7c56201184091a97c7b58d073.camel@perches.com> Subject: Re: [PATCH v4] checkpatch: improve email parsing From: Joe Perches To: Dwaipayan Ray Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel , Lukas Bulwahn , Aditya Srivastava Date: Fri, 06 Nov 2020 21:09:39 -0800 In-Reply-To: References: <20201106214530.367247-1-dwaipayanray1@gmail.com> <38c2889ad15c0f34ce8c223518f1f6dbc9945286.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-11-07 at 10:11 +0530, Dwaipayan Ray wrote: > On Sat, Nov 7, 2020 at 3:34 AM Joe Perches wrote: > > > > On Sat, 2020-11-07 at 03:15 +0530, Dwaipayan Ray wrote: > > > checkpatch doesn't report warnings for many common mistakes > > > in emails. Some of which are trailing commas and incorrect > > > use of email comments. > > > > Assuming it all works, this looks good. I haven't tested it. > > > > How did you test the $fix bits? > > > Hi, > I actually dumped about 17k unique emails from git log, put it in one of > my previous patches, and ran checkpatch with --fix on it. > I checked the diff and most of the cases looked pretty good to me. > I could send the diff output if you like? Please. Likely just to me as I imagine it's not interesting to most. > > Trivial notes: > > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > [] > > > + # stable@vger.kernel.org or stable@kernel.org shouldn't > > > + # have an email name. In addition commments should strictly > > > + # begin with a # > > > + if ($email =~ /^.*stable\@(?:vger\.)?kernel\.org/) { > > > > Likely better to test with a case insensitive match so > > STABLE@vger.kernel.org and such are still warned. > > Sure, I will do that. > > > >                                 if ($email =~ /\bstable\@(?:vger\.)?kernel\.org\b/i) { > > > > > + if ($sign_off =~ /cc:$/i && (($comment ne "" && $comment !~ /^#.+/) || > > > + ($email_name ne ""))) { > > > > > > $sign_off !~ /^cc:/i ? > > I actually had a doubt about that one. Only the stable address with > Cc: should be checked right? Or something else? yes. > What about those stable addresses with tags other than Cc: ? Should > a change be suggested? Ideally yes, but there were very few of those in the git commit history so it's probably not a big deal one way or another.