summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-05 11:03:45 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-07 15:03:23 -0400
commita94db588db5e2983112301e94b2133b5a3f03875 (patch)
treef1ddbc979c7022dadef9644c84069837adfe278b
parent030c5ce0a58e212eb7b973e1206b775085b74afb (diff)
downloadhaskell-a94db588db5e2983112301e94b2133b5a3f03875.tar.gz
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.
-rw-r--r--testsuite/driver/perf_notes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/driver/perf_notes.py b/testsuite/driver/perf_notes.py
index 390d21a124..53b5019dab 100644
--- a/testsuite/driver/perf_notes.py
+++ b/testsuite/driver/perf_notes.py
@@ -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 strings.gs.s..
qstrList = r"(?:\["+s+r"?"+innerQstrList+s+r"?\])" # A list of strings (using box brackets)..
- exp = (r"^Metric"
+ exp = (r"^\s*Metric"
+s+r"(Increase|Decrease)"
+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)