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,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 71893C63777 for ; Mon, 30 Nov 2020 16:44:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 312D82074A for ; Mon, 30 Nov 2020 16:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728619AbgK3QoC (ORCPT ); Mon, 30 Nov 2020 11:44:02 -0500 Received: from smtprelay0224.hostedemail.com ([216.40.44.224]:56998 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725859AbgK3QoC (ORCPT ); Mon, 30 Nov 2020 11:44:02 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id CC309837F24C; Mon, 30 Nov 2020 16:43:19 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: lip88_3b10053273a3 X-Filterd-Recvd-Size: 1906 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Mon, 30 Nov 2020 16:43:18 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: fix TYPO_SPELLING check for words with apostrophe From: Joe Perches To: Dwaipayan Ray Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com, Peilin Ye Date: Mon, 30 Nov 2020 08:43:17 -0800 In-Reply-To: <20201130144515.8320-1-dwaipayanray1@gmail.com> References: <20201130144515.8320-1-dwaipayanray1@gmail.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 Mon, 2020-11-30 at 20:15 +0530, Dwaipayan Ray wrote: > checkpatch reports a false TYPO_SPELLING warning for some words > containing an apostrophe. > > A false positive is "doesn't". Occurrence of the word causes > checkpatch to emit the following warning: > > "WARNING: 'doesn'' may be misspelled - perhaps 'doesn't'?" > > Check the word boundary for such cases so that words like > "doesn't", "zig-zag", etc. aren't misinterpreted due to wrong > splitting of the word by the \b regex metacharacter. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3106,7 +3106,7 @@ 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 =~ /(?:^|[^a-z@])($misspellings)(?:\b(?![^\w]?[a-z@]+)|$|[^a-z@])/gi) { Wouldn't it be simpler to change the existing [^a-z@] blocks to [^a-z@'-] ?