Commit a94db588 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Allow whitespace before "Metric (in|de)crease"

Several people have struggled with metric change annotations
in their commit messages not being recognized due to the fact that
GitLab's job log inserts a space at the beginning of each line. Teach
the regular expression to accept this whitespace.
parent 030c5ce0
......@@ -212,7 +212,7 @@ def parse_allowed_perf_changes(commitMsg: str
innerQstrList = r"(?:"+qstr+r"(?:"+s+r"?,"+s+r"?"+qstr+r")*)?" # Inside of a list of
qstrList = r"(?:\["+s+r"?"+innerQstrList+s+r"?\])" # A list of strings (using box brackets)..
exp = (r"^Metric"
exp = (r"^\s*Metric"
+s+r"?("+qstr+r"|"+qstrList+r")?" # Metric or list of metrics.s..
+s+r"?(\(" + r"(?:[^')]|"+qstr+r")*" + r"\))?" # Options surrounded in parenthesis. (allow parenthases in quoted strings)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment