summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2021-09-10 11:08:14 +0200
committerIlya Maximets <i.maximets@ovn.org>2021-11-04 22:26:00 +0100
commitc5d384f77bed0e3f540987314072166bfcbff1a2 (patch)
treed0b8c289b34c55361fe5366e8c1bd245469a68d3 /utilities
parent9f2258360f2cdca4725c8ca4a1a3dc40ef7b914b (diff)
downloadopenvswitch-c5d384f77bed0e3f540987314072166bfcbff1a2.tar.gz
checkpatch: Check if some tags are wrongly written.
Currently, there are some patches with the tags wrongly written (with space instead of dash ) and this may prevent some automatic system or CI to detect them correctly. This commit adds a check in checkpatch to be sure the tag is written correctly with dash and not with space. The tags supported by the commit are: Acked-by, Reported-at, Reported-by, Requested-by, Reviewed-by, Submitted-at and Suggested-by. It's not necessary to add "Signed-off-by" since it's already checked in checkpatch. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'utilities')
-rwxr-xr-xutilities/checkpatch.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 16f46c78e..bf95358d5 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -753,6 +753,16 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None):
is_gerrit_change_id = re.compile(r'(\s*(change-id: )(.*))$',
re.I | re.M | re.S)
+ tags_typos = {
+ r'^Acked by:': 'Acked-by:',
+ r'^Reported at:': 'Reported-at:',
+ r'^Reported by:': 'Reported-by:',
+ r'^Requested by:': 'Requested-by:',
+ r'^Reviewed by:': 'Reviewed-by:',
+ r'^Submitted at:': 'Submitted-at:',
+ r'^Suggested by:': 'Suggested-by:',
+ }
+
reset_counters()
for line in text.splitlines():
@@ -842,6 +852,11 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None):
print("%d: %s\n" % (lineno, line))
elif spellcheck:
check_spelling(line, False)
+ for typo, correct in tags_typos.items():
+ m = re.match(typo, line, re.I)
+ if m:
+ print_error("%s tag is malformed." % (correct[:-1]))
+ print("%d: %s\n" % (lineno, line))
elif parse == PARSE_STATE_CHANGE_BODY:
newfile = hunks.match(line)