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

check_spelling: allow joining hyphenated words

Accept the spelling for hyphenated words
when the spelling of each individual word is correct.

This suppresses many terms that are better treated as false positives
such as user-defined, multi-input and edit-data.
parent 4b7563b6
Branches
Tags
No related merge requests found
......@@ -406,8 +406,17 @@ def spell_check_file(
if w_lower in dict_custom or w_lower in dict_ignore:
continue
if not dict_spelling.check(w):
is_good_spelling = dict_spelling.check(w)
if not is_good_spelling:
if "-" in w:
is_good_spelling = True
for w_sub in w.split("-"):
if w_sub:
if not dict_spelling.check(w_sub):
is_good_spelling = False
break
if not is_good_spelling:
# Ignore literals that show up in code,
# gets rid of a lot of noise from comments that reference variables.
if w in code_words:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment