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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,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 0F086C64E7B for ; Tue, 1 Dec 2020 20:26:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A96E6206E0 for ; Tue, 1 Dec 2020 20:26:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392461AbgLAUZz (ORCPT ); Tue, 1 Dec 2020 15:25:55 -0500 Received: from smtprelay0003.hostedemail.com ([216.40.44.3]:56378 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389343AbgLAUZy (ORCPT ); Tue, 1 Dec 2020 15:25:54 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 94328180A8123; Tue, 1 Dec 2020 20:25:13 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: touch68_2b14747273ad X-Filterd-Recvd-Size: 2075 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA; Tue, 1 Dec 2020 20:25:12 +0000 (UTC) Message-ID: <09c24ef1aa2f1c4fe909d76f5426f08780b9d81c.camel@perches.com> Subject: Re: [PATCH v3] checkpatch: fix TYPO_SPELLING check for words with apostrophe From: Joe Perches To: Dwaipayan Ray , Andrew Morton Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, Peilin Ye Date: Tue, 01 Dec 2020 12:25:11 -0800 In-Reply-To: <7f29e46d73c0b12ce53e659f0bcd3ec194522f2e.camel@perches.com> References: <20201201190729.169733-1-dwaipayanray1@gmail.com> <7f29e46d73c0b12ce53e659f0bcd3ec194522f2e.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 Tue, 2020-12-01 at 11:32 -0800, Joe Perches wrote: > On Wed, 2020-12-02 at 00:37 +0530, Dwaipayan Ray wrote: > > checkpatch reports a false TYPO_SPELLING warning for some words > > containing an apostrophe when run with --codespell option. Hey Andrew. If Dwaipayan doesn't mind, can you update this when you apply it to extend the length of the caret printed? > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > > @@ -3106,15 +3106,18 @@ sub process { > >  # Check for various typo / spelling mistakes > >   if (defined($misspellings) && > >   ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { > > - while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) { > > + while ($rawline =~ /(?:^|[^\w\-'`])($misspellings)(?:[^\w\-'`]|$)/gi) { > >   my $typo = $1; > > + my $blank = copy_spacing($rawline); > > + my $ptr = substr($blank, 0, $-[1]) . "^"; Changing this to: my $ptr = substr($blank, 0, $-[1]) . "^" x length($typo); makes the matched misspelling more obvious Thanks, Joe