Skip to content
Snippets Groups Projects
Commit dc3f3f11 authored by Campbell Barton's avatar Campbell Barton
Browse files

check_spelling: ignore common suffix's when hyphenated

Allow informal convention of adding -ish or -ness onto the end of any word.
This is done a handful of times and seems reasonable to support.
parent 5469f99c
Branches
Tags
No related merge requests found
...@@ -74,6 +74,7 @@ from check_spelling_c_config import ( ...@@ -74,6 +74,7 @@ from check_spelling_c_config import (
dict_custom, dict_custom,
dict_ignore, dict_ignore,
dict_ignore_hyphenated_prefix, dict_ignore_hyphenated_prefix,
dict_ignore_hyphenated_suffix,
files_ignore, files_ignore,
) )
...@@ -114,8 +115,13 @@ def dictionary_check(w: str) -> bool: ...@@ -114,8 +115,13 @@ def dictionary_check(w: str) -> bool:
# Allow: `un-word`, `re-word`. # Allow: `un-word`, `re-word`.
w_split = w.strip("-").split("-") w_split = w.strip("-").split("-")
if len(w_split) > 1:
if w_split and w_split[0].lower() in dict_ignore_hyphenated_prefix: if w_split and w_split[0].lower() in dict_ignore_hyphenated_prefix:
del w_split[0] del w_split[0]
# Allow: `word-ish`, `word-ness`.
if len(w_split) > 1:
if w_split and w_split[-1].lower() in dict_ignore_hyphenated_suffix:
del w_split[-1]
for w_sub in w_split: for w_sub in w_split:
if w_sub: if w_sub:
......
...@@ -450,6 +450,11 @@ dict_ignore_hyphenated_prefix = { ...@@ -450,6 +450,11 @@ dict_ignore_hyphenated_prefix = {
"un", "un",
} }
dict_ignore_hyphenated_suffix = {
"ish",
"ness",
}
files_ignore = { files_ignore = {
"source/tools/utils_doc/rna_manual_reference_updater.py", # Contains language ID references. "source/tools/utils_doc/rna_manual_reference_updater.py", # Contains language ID references.
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment