[ovs-dev] [PATCH 1/3] checkpatch: Allow common abbreviations for spell checking.

Ilya Maximets i.maximets at ovn.org
Sun Dec 8 19:42:32 UTC 2019


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 at ovn.org>
---
 utilities/checkpatch.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 9b79d268f..6d95b0e2f 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -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
-- 
2.17.1



More information about the dev mailing list