2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

checkpatch: Allow common abbreviations for spell checking.

Abbreviations of Latin expressions like 'i.e.' or 'e.g.' are common
and known by the dictionary.  However, our spell checker is not able
to recognize them because it strips dots out of them.  To avoid this
issue we could pass non-stripped version of the word to the dictionary
checker too.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: William Tu <u9012063@gmail.com>
This commit is contained in:
Ilya Maximets
2019-12-07 18:02:01 +01:00
parent 40570384bc
commit 98a411b32e

View File

@@ -380,7 +380,9 @@ def check_comment_spelling(line):
for word in comment_words:
skip = False
strword = re.subn(r'\W+', '', word)[0].replace(',', '')
if len(strword) and not spell_check_dict.check(strword.lower()):
if (len(strword)
and not spell_check_dict.check(strword.lower())
and not spell_check_dict.check(word.lower())):
if any([check_char in word
for check_char in ['=', '(', '-', '_', '/', '\'']]):
skip = True