2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

checkpatch: Reorganize flagged words using a list.

Single out flagged words and allow for more useful
details, like spelling suggestions.

Signed-off-by: Chandan Somani <csomani@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
This commit is contained in:
Chandan Somani
2023-07-07 16:07:56 -04:00
committed by Eelco Chaudron
parent f770b8c133
commit d25c6bd8df

View File

@@ -411,6 +411,8 @@ def check_spelling(line, comment):
words = filter_comments(line, True) if comment else line
words = words.replace(':', ' ').split(' ')
flagged_words = []
for word in words:
skip = False
strword = re.subn(r'\W+', '', word)[0].replace(',', '')
@@ -435,9 +437,13 @@ def check_spelling(line, comment):
skip = True
if not skip:
print_warning("Check for spelling mistakes (e.g. \"%s\")"
% strword)
return True
flagged_words.append(strword)
if len(flagged_words) > 0:
for mistake in flagged_words:
print_warning("Possible misspelled word: \"%s\"" % mistake)
return True
return False