From 9f7c6b7a096d0e2b367e7fdda7902a430a5c8705 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Wed, 24 Sep 2025 20:57:47 +0100 Subject: patchtest: Use raw strings for regex patterns This fixes several 'SyntaxWarning: invalid escape sequence' messages printed when running patchtest. Cc: Trevor Gamblin (From OE-Core rev: c585977a6b55db93b7f432280ae4251aa9bc6b6c) Signed-off-by: Paul Barker Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/lib/patchtest/patchtest_patterns.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'meta/lib/patchtest/patchtest_patterns.py') 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' lictag_re = pyparsing.AtLineStart("License-Update:") lic_chksum_added = pyparsing.AtLineStart("+" + metadata_chksum) lic_chksum_removed = pyparsing.AtLineStart("-" + metadata_chksum) -add_mark = pyparsing.Regex('\\+ ') +add_mark = pyparsing.Regex(r'\+ ') patch_max_line_length = 200 metadata_src_uri = "SRC_URI" metadata_summary = "SUMMARY" @@ -51,20 +51,20 @@ auh_email = 'auh@yoctoproject.org' invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"), pyparsing.Regex(auh_email), - pyparsing.Regex("uh@not\.set"), - pyparsing.Regex("\S+@example\.com")] + pyparsing.Regex(r"uh@not\.set"), + pyparsing.Regex(r"\S+@example\.com")] -mbox_bugzilla = pyparsing.Regex('\[\s?YOCTO.*\]') -mbox_bugzilla_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') -mbox_revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') +mbox_bugzilla = pyparsing.Regex(r'\[\s?YOCTO.*\]') +mbox_bugzilla_validation = pyparsing.Regex(r'\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') +mbox_revert_shortlog_regex = pyparsing.Regex(r'Revert\s+".*"') mbox_shortlog_maxlength = 90 # based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript -mbox_github_username = pyparsing.Regex('\B(?[A-Za-z0-9._%+-]+)@(?P[A-Za-z0-9.-]+)\.(?P[A-Za-z]{2,})") signed_off_by_prefix = pyparsing.Literal("Signed-off-by:") -signed_off_by_name = pyparsing.Regex('\S+.*(?= <)') +signed_off_by_name = pyparsing.Regex(r'\S+.*(?= <)') signed_off_by_email = lessthan + email_pattern + greaterthan signed_off_by = pyparsing.AtLineStart(signed_off_by_prefix + signed_off_by_name + signed_off_by_email) patch_signed_off_by = pyparsing.AtLineStart("+" + signed_off_by_prefix + signed_off_by_name + signed_off_by_email) -- cgit v1.2.3-54-g00ecf