From e6032917ab3817c191d02fece3d17c199402ee53 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Fri, 28 Jul 2023 11:35:05 +0200 Subject: [PATCH] Remove the grave accent (`) from the default word regex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catching typos that contain a grave accent (`) is a niche. I bet we miss more typos in Markdown files than we detect typos containing a grave accent (`). Additionally, this restores compliance with the documentation: By default any alphanumeric character, the underscore, the hyphen, and the apostrophe is used to build words. This option cannot be specified together with --write-changes." Use plural in the above help message: is → are --- codespell_lib/_codespell.py | 4 ++-- codespell_lib/data/dictionary.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index 800e12c9947..2e23b9acd63 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -28,7 +28,7 @@ # autogenerated by setuptools_scm from ._version import __version__ as VERSION # type: ignore # noqa: N812 -word_regex_def = "[\\w\\-'’`]+" +word_regex_def = r"[\w\-'’]+" # While we want to treat characters like ( or " as okay for a starting break, # these may occur unescaped in URIs, and so we are more restrictive on the # endpoint. Emails are more restrictive, so the endpoint remains flexible. @@ -402,7 +402,7 @@ def parse_options( type=str, help="regular expression that is used to find words. " "By default any alphanumeric character, the " - "underscore, the hyphen, and the apostrophe is " + "underscore, the hyphen, and the apostrophe are " "used to build words. This option cannot be " "specified together with --write-changes.", ) diff --git a/codespell_lib/data/dictionary.txt b/codespell_lib/data/dictionary.txt index c287267d986..8320e9788c0 100644 --- a/codespell_lib/data/dictionary.txt +++ b/codespell_lib/data/dictionary.txt @@ -12234,7 +12234,7 @@ cought->caught, cough, fought, coul->could could'nt->couldn't could't->couldn't -coulden`t->couldn't +coulden't->couldn't couldent->couldn't couldn->could, couldn't, couldn;t->couldn't @@ -48160,7 +48160,7 @@ woudl->would woudn't->wouldn't would'nt->wouldn't would't->wouldn't -woulden`t->wouldn't +woulden't->wouldn't wouldent->wouldn't wouldn;t->wouldn't wouldnt'->wouldn't