summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/patchtest_patterns.py
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-10-04 09:39:54 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-23 17:35:23 +0100
commitdab2dcae89d349366edc3cfa09c312fab8cf14b8 (patch)
tree934f0badbfb21c52b465a5f801374115f340393e /meta/lib/patchtest/patchtest_patterns.py
parenta20bbe112331c1cb99a78a7263d3f76a083ad13b (diff)
downloadpoky-dab2dcae89d349366edc3cfa09c312fab8cf14b8.tar.gz
patchtest: add test_commit_message_user_tags
This test makes patchtest check to ensure that there aren't any GitHub-style user account names being tagged in the commit message, e.g. it should catch lines like: "fix added by @threexc" This is desired so that if (for example) we add upstream changelogs in recipe upgrade commit messages verbatim, we don't end up subscribing any associated maintainers to our repo mirrors' updates by accident. There is a small possibility of a false positive with this test, where if someone is mentioning Python decorators in their commit message (or similar syntax from other languages), it will fail when it should pass. However, having this test in place to guard against username inclusion is more important that the occasional false positive for that reason. With this addition, a failure will look like: |FAIL: test commit message user tags: Mbox includes one or more GitHub-style username tags. Ensure that any "@" symbols are stripped out of usernames (test_mbox.TestMbox.test_commit_message_user_tags) (From OE-Core rev: 8278d82d8203212bb159eb3805d4a5617c5370df) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/patchtest_patterns.py')
-rw-r--r--meta/lib/patchtest/patchtest_patterns.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/patchtest/patchtest_patterns.py b/meta/lib/patchtest/patchtest_patterns.py
index 8c2e192fc9..39c5a65d91 100644
--- a/meta/lib/patchtest/patchtest_patterns.py
+++ b/meta/lib/patchtest/patchtest_patterns.py
@@ -58,6 +58,8 @@ mbox_bugzilla = pyparsing.Regex('\[\s?YOCTO.*\]')
58mbox_bugzilla_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') 58mbox_bugzilla_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
59mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') 59mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
60mbox_shortlog_maxlength = 90 60mbox_shortlog_maxlength = 90
61# based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript
62mbox_github_username = pyparsing.Regex('\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))')
61 63
62# patch 64# patch
63 65