mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
checkpatch: Add suggestions to the spell checker.
This will be useful for correcting possible spelling mistakes with ease. Suggestions limited to 3 at first, but can be made configurable in the future. Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Chandan Somani <csomani@redhat.com> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
committed by
Eelco Chaudron
parent
d25c6bd8df
commit
9a50170a80
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user