Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3444)

Unified Diff: chrome/browser/resources/PRESUBMIT.py

Issue 809053003: Presubmit for chrome/browser/resources matches multiline metric types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/PRESUBMIT.py
diff --git a/chrome/browser/resources/PRESUBMIT.py b/chrome/browser/resources/PRESUBMIT.py
index d603cc001878c93e39c0b23d385005b5f542a724..ac03df706a049b1974f93e5beb03a31f00e4f472 100644
--- a/chrome/browser/resources/PRESUBMIT.py
+++ b/chrome/browser/resources/PRESUBMIT.py
@@ -79,10 +79,10 @@ def IsBoolean(new_content_lines, metric_name, input_api):
new_content = '\n'.join(new_content_lines)
html_element_re = r'<(.*?)(^|\s+)metric\s*=\s*"%s"(.*?)>' % (metric_name)
- type_re = (r'datatype="boolean"|type="checkbox"|type="radio".*?'
- 'value=("true"|"false")')
+ type_re = (r'datatype\s*=\s*"boolean"|type\s*=\s*"checkbox"|'
+ 'type\s*=\s*"radio".*?value\s*=\s*("true"|"false")')
- match = input_api.re.search(html_element_re, new_content)
+ match = input_api.re.search(html_element_re, new_content, input_api.re.DOTALL)
return (match and
any(input_api.re.search(type_re, match.group(i)) for i in (1, 3)))

Powered by Google App Engine
This is Rietveld 408576698