diff --git a/check_source/check_spelling.py b/check_source/check_spelling.py index 6e140e76a1849f8507f785ad0062aca3f4709431..704e2354d7a7c137cd2dd18ee4e6bf8aed938719 100755 --- a/check_source/check_spelling.py +++ b/check_source/check_spelling.py @@ -74,6 +74,7 @@ from check_spelling_c_config import ( dict_custom, dict_ignore, dict_ignore_hyphenated_prefix, + dict_ignore_hyphenated_suffix, files_ignore, ) @@ -114,8 +115,13 @@ def dictionary_check(w: str) -> bool: # Allow: `un-word`, `re-word`. w_split = w.strip("-").split("-") - if w_split and w_split[0].lower() in dict_ignore_hyphenated_prefix: - del w_split[0] + if len(w_split) > 1: + if w_split and w_split[0].lower() in dict_ignore_hyphenated_prefix: + 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: if w_sub: diff --git a/check_source/check_spelling_c_config.py b/check_source/check_spelling_c_config.py index f807cbedfcdb5ba3c055a2d9439a8798804bcfc3..1c074e00e796e69c7021d8436e0490b090494be1 100644 --- a/check_source/check_spelling_c_config.py +++ b/check_source/check_spelling_c_config.py @@ -450,6 +450,11 @@ dict_ignore_hyphenated_prefix = { "un", } +dict_ignore_hyphenated_suffix = { + "ish", + "ness", +} + files_ignore = { "source/tools/utils_doc/rna_manual_reference_updater.py", # Contains language ID references. }