Re: [PATCH] checkpatch: fix TYPO_SPELLING check for words with apostrophe

From: Joe Perches
Date: Mon Nov 30 2020 - 14:38:20 EST


On Mon, 2020-11-30 at 23:56 +0530, Dwaipayan Ray wrote:
> Thanks, this does resolve the original problem, but again the following
> line throws 0 warnings:
>
> "zeebra" ther, yourr.
>
> Any punctuation separators are ignored :(
>
>  (?:^|\s)($misspellings)(?=[\s\.\,\:\;\"\?\!]|$)
>
> Would this be acceptable rather? But again this doesn't
> handle [therr] or (therr).

No idea.
What does codespell use for its regex?
Maybe that should be used.

Maybe all the added lines should be collected and
codespell should be called on those lines instead.

Try other options and check if the overall cpu/wall clock use is reduced.

Adding codespell's dictionary was kind of a 'nice to have' option and
it's not likely that it matters a lot if it's perfect or not.

My presumption is that it's not frequently used, but hey, who knows.