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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 7254FC43467 for ; Wed, 14 Oct 2020 18:35:40 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D56FC2222A for ; Wed, 14 Oct 2020 18:35:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D56FC2222A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 206FF2E517; Wed, 14 Oct 2020 18:35:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9xynR7NiTIb9; Wed, 14 Oct 2020 18:35:34 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id B9E762E2D8; Wed, 14 Oct 2020 18:35:34 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AF0C8C0052; Wed, 14 Oct 2020 18:35:34 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id B30FAC0051 for ; Wed, 14 Oct 2020 18:35:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 987CB87DD2 for ; Wed, 14 Oct 2020 18:35:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jvnt5BwkHMry for ; Wed, 14 Oct 2020 18:35:29 +0000 (UTC) X-Greylist: delayed 02:17:38 by SQLgrey-1.7.6 Received: from smtprelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by hemlock.osuosl.org (Postfix) with ESMTPS id BD77887DC7 for ; Wed, 14 Oct 2020 18:35:29 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id E8CC6702; Wed, 14 Oct 2020 18:35:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: paper27_54145cd2720e X-Filterd-Recvd-Size: 2366 Received: from XPS-9350 (cpe-72-134-80-165.natsow.res.rr.com [72.134.80.165]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Wed, 14 Oct 2020 18:35:26 +0000 (UTC) Message-ID: <7d8c7d80aa7b0524cca49a6dfe24e878bea6ab12.camel@perches.com> From: Joe Perches To: Dwaipayan Ray Date: Wed, 14 Oct 2020 11:35:25 -0700 In-Reply-To: References: <20201014163738.117332-1-dwaipayanray1@gmail.com> User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [Linux-kernel-mentees] [PATCH v2] checkpatch: add new exception to repeated word check X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Wed, 2020-10-14 at 23:42 +0530, Dwaipayan Ray wrote: > On Wed, Oct 14, 2020 at 11:33 PM Joe Perches wrote: > > On Wed, 2020-10-14 at 22:07 +0530, Dwaipayan Ray wrote: > > > Recently, commit 4f6ad8aa1eac ("checkpatch: move repeated word test") > > > moved the repeated word test to check for more file types. But after > > > this, if checkpatch.pl is run on MAINTAINERS, it generates several > > > new warnings of the type: > > > > Perhaps instead of adding more content checks so that > > word boundaries are not something like \S but also > > not punctuation so that content like > > > > git git:// > > @size size > > > > does not match? > > > > > Hi, > So currently the words are trimmed of non alphabets before the check: > > while ($rawline =~ /\b($word_pattern) (?=($word_pattern))/g) { > my $first = $1; > my $second = $2; > > where, the word_pattern is: > my $word_pattern = '\b[A-Z]?[a-z]{2,}\b'; I'm familiar. > So do you perhaps recommend modifying this word pattern to > include the punctuation as well rather than trimming them off? Not really, perhaps use the capture group position markers @- @+ or $-[1] $+[1] and $-[2] $+[2] with the substr could be used to see what characters are before and after the word matches. > > Thanks, > Dwaipayan. _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees