Skip to content

Commit

Permalink
Remove the backtick U+0060 (`) from the default word regex
Browse files Browse the repository at this point in the history
Catching typos that contain a backtick or grave accent (`) is a niche.
I bet we miss more typos inside backticks in Markdown files than we
detect typos containing a backtick.

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
  • Loading branch information
DimitriPapadopoulos committed Aug 1, 2023
1 parent 54467a2 commit dadd0a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.",
)
Expand Down
4 changes: 2 additions & 2 deletions codespell_lib/data/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dadd0a3

Please sign in to comment.