class Base(unittest.TestCase):
# if unit test fails, fail message will throw at least the following JSON: {"id": <testid>}
- endcommit_messages_regex = re.compile('\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n')
- patchmetadata_regex = re.compile('-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+')
+ endcommit_messages_regex = re.compile(r'\(From \w+-\w+ rev:|(?<!\S)Signed-off-by|(?<!\S)---\n')
+ patchmetadata_regex = re.compile(r'-{3} \S+|\+{3} \S+|@{2} -\d+,\d+ \+\d+,\d+ @{2} \S+')
@staticmethod
if len(mbox):
subject = mbox[0]['subject']
if subject:
- pattern = re.compile("(\[.*\])", re.DOTALL)
+ pattern = re.compile(r"(\[.*\])", re.DOTALL)
match = pattern.search(subject)
if match:
prefix = match.group(1)
invalid = lbranch.startswith('patch') or \
lbranch.startswith('rfc') or \
lbranch.startswith('resend') or \
- re.search('^v\d+', lbranch) or \
- re.search('^\d+/\d+', lbranch)
+ re.search(r'^v\d+', lbranch) or \
+ re.search(r'^\d+/\d+', lbranch)
return not invalid