diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2022-07-26 15:29:55 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-08-04 14:06:37 +0200 |
commit | 91b41af0d9b33ea9f3f739cae4d0e20a30330cae (patch) | |
tree | 0c7960c210fbe54ef384e8d153c253ec6856eb75 /utilities | |
parent | 6a9ec13aa3560b339f381605afbb2fff5ba3a6e2 (diff) | |
download | openvswitch-91b41af0d9b33ea9f3f739cae4d0e20a30330cae.tar.gz |
checkpatch: Add check for a Fixes tag.
A new check for common mistakes while formatting a 'Fixes:' tag.
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'utilities')
-rwxr-xr-x | utilities/checkpatch.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index de2420e1f..887928404 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -793,6 +793,8 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None): re.I | re.M | re.S) is_gerrit_change_id = re.compile(r'(\s*(change-id: )(.*))$', re.I | re.M | re.S) + is_fixes = re.compile(r'(\s*(Fixes:)(.*))$', re.I | re.M | re.S) + is_fixes_exact = re.compile(r'^Fixes: [0-9a-f]{12} \(".*"\)$') tags_typos = { r'^Acked by:': 'Acked-by:', @@ -895,6 +897,13 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None): print_error( "Remove Gerrit Change-Id's before submitting upstream.") print("%d: %s\n" % (lineno, line)) + elif is_fixes.match(line) and not is_fixes_exact.match(line): + print_error('"Fixes" tag is malformed.\n' + 'Use the following format:\n' + ' git log -1 ' + '--pretty=format:"Fixes: %h (\\\"%s\\\")" ' + '--abbrev=12 COMMIT_REF\n') + print("%d: %s\n" % (lineno, line)) elif spellcheck: check_spelling(line, False) for typo, correct in tags_typos.items(): |