This will be useful for correcting possible spelling
mistakes with ease. Suggestions limited to 3 at first,
but configurable in the future.

Signed-off-by: Chandan Somani <csom...@redhat.com>
Acked-by: Aaron Conole <acon...@redhat.com>
---
 utilities/checkpatch.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index acf9a0102..e5d5029f2 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -412,6 +412,7 @@ def check_spelling(line, comment):
     words = words.replace(':', ' ').split(' ')
 
     flagged_words = []
+    num_suggestions = 3
 
     for word in words:
         skip = False
@@ -442,6 +443,8 @@ def check_spelling(line, comment):
     if len(flagged_words) > 0:
         for mistake in flagged_words:
             print_warning("Possible misspelled word: \"%s\"" % mistake)
+            print("Did you mean: ",
+                  spell_check_dict.suggest(mistake)[:num_suggestions])
 
         return True
 
-- 
2.26.3

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to