summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/patchtest')
-rw-r--r--meta/lib/patchtest/patchtest_patterns.py20
-rw-r--r--meta/lib/patchtest/tests/test_mbox.py4
2 files changed, 12 insertions, 12 deletions
diff --git a/meta/lib/patchtest/patchtest_patterns.py b/meta/lib/patchtest/patchtest_patterns.py
index 655ecfd049..1a8db92aa5 100644
--- a/meta/lib/patchtest/patchtest_patterns.py
+++ b/meta/lib/patchtest/patchtest_patterns.py
@@ -33,7 +33,7 @@ closed = 'CLOSED'
33lictag_re = pyparsing.AtLineStart("License-Update:") 33lictag_re = pyparsing.AtLineStart("License-Update:")
34lic_chksum_added = pyparsing.AtLineStart("+" + metadata_chksum) 34lic_chksum_added = pyparsing.AtLineStart("+" + metadata_chksum)
35lic_chksum_removed = pyparsing.AtLineStart("-" + metadata_chksum) 35lic_chksum_removed = pyparsing.AtLineStart("-" + metadata_chksum)
36add_mark = pyparsing.Regex('\\+ ') 36add_mark = pyparsing.Regex(r'\+ ')
37patch_max_line_length = 200 37patch_max_line_length = 200
38metadata_src_uri = "SRC_URI" 38metadata_src_uri = "SRC_URI"
39metadata_summary = "SUMMARY" 39metadata_summary = "SUMMARY"
@@ -51,20 +51,20 @@ auh_email = 'auh@yoctoproject.org'
51 51
52invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"), 52invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"),
53 pyparsing.Regex(auh_email), 53 pyparsing.Regex(auh_email),
54 pyparsing.Regex("uh@not\.set"), 54 pyparsing.Regex(r"uh@not\.set"),
55 pyparsing.Regex("\S+@example\.com")] 55 pyparsing.Regex(r"\S+@example\.com")]
56 56
57mbox_bugzilla = pyparsing.Regex('\[\s?YOCTO.*\]') 57mbox_bugzilla = pyparsing.Regex(r'\[\s?YOCTO.*\]')
58mbox_bugzilla_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') 58mbox_bugzilla_validation = pyparsing.Regex(r'\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
59mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') 59mbox_revert_shortlog_regex = pyparsing.Regex(r'Revert\s+".*"')
60mbox_shortlog_maxlength = 90 60mbox_shortlog_maxlength = 90
61# based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript 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]))') 62mbox_github_username = pyparsing.Regex(r'\B(?<!\${)@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))')
63 63
64# patch 64# patch
65 65
66cve = pyparsing.Regex("CVE\-\d{4}\-\d+") 66cve = pyparsing.Regex(r"CVE\-\d{4}\-\d+")
67cve_payload_tag = pyparsing.Regex("\+CVE:(\s+CVE\-\d{4}\-\d+)+") 67cve_payload_tag = pyparsing.Regex(r"\+CVE:(\s+CVE\-\d{4}\-\d+)+")
68upstream_status_regex = pyparsing.AtLineStart("+" + "Upstream-Status") 68upstream_status_regex = pyparsing.AtLineStart("+" + "Upstream-Status")
69 69
70# shortlog 70# shortlog
@@ -78,7 +78,7 @@ shortlog = line_start + shortlog_target + colon + shortlog_summary + line_end
78email_pattern = pyparsing.Regex(r"(?P<user>[A-Za-z0-9._%+-]+)@(?P<hostname>[A-Za-z0-9.-]+)\.(?P<domain>[A-Za-z]{2,})") 78email_pattern = pyparsing.Regex(r"(?P<user>[A-Za-z0-9._%+-]+)@(?P<hostname>[A-Za-z0-9.-]+)\.(?P<domain>[A-Za-z]{2,})")
79 79
80signed_off_by_prefix = pyparsing.Literal("Signed-off-by:") 80signed_off_by_prefix = pyparsing.Literal("Signed-off-by:")
81signed_off_by_name = pyparsing.Regex('\S+.*(?= <)') 81signed_off_by_name = pyparsing.Regex(r'\S+.*(?= <)')
82signed_off_by_email = lessthan + email_pattern + greaterthan 82signed_off_by_email = lessthan + email_pattern + greaterthan
83signed_off_by = pyparsing.AtLineStart(signed_off_by_prefix + signed_off_by_name + signed_off_by_email) 83signed_off_by = pyparsing.AtLineStart(signed_off_by_prefix + signed_off_by_name + signed_off_by_email)
84patch_signed_off_by = pyparsing.AtLineStart("+" + signed_off_by_prefix + signed_off_by_name + signed_off_by_email) 84patch_signed_off_by = pyparsing.AtLineStart("+" + signed_off_by_prefix + signed_off_by_name + signed_off_by_email)
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py
index 714c9b30af..5cf02af7bd 100644
--- a/meta/lib/patchtest/tests/test_mbox.py
+++ b/meta/lib/patchtest/tests/test_mbox.py
@@ -71,7 +71,7 @@ class TestMbox(base.Base):
71 def test_shortlog_length(self): 71 def test_shortlog_length(self):
72 for commit in self.commits: 72 for commit in self.commits:
73 # no reason to re-check on revert shortlogs 73 # no reason to re-check on revert shortlogs
74 shortlog = re.sub('^(\[.*?\])+ ', '', commit.shortlog) 74 shortlog = re.sub(r'^(\[.*?\])+ ', '', commit.shortlog)
75 if shortlog.startswith('Revert "'): 75 if shortlog.startswith('Revert "'):
76 continue 76 continue
77 l = len(shortlog) 77 l = len(shortlog)
@@ -109,7 +109,7 @@ class TestMbox(base.Base):
109 109
110 # a meta project may be indicted in the message subject, if this is the case, just fail 110 # a meta project may be indicted in the message subject, if this is the case, just fail
111 # TODO: there may be other project with no-meta prefix, we also need to detect these 111 # TODO: there may be other project with no-meta prefix, we also need to detect these
112 project_regex = pyparsing.Regex("\[(?P<project>meta-.+)\]") 112 project_regex = pyparsing.Regex(r"\[(?P<project>meta-.+)\]")
113 for commit in self.commits: 113 for commit in self.commits:
114 match = project_regex.search_string(commit.subject) 114 match = project_regex.search_string(commit.subject)
115 if match: 115 if match: