Accept buganizer tickets in TODO comments.
Bug: b/271240665
Change-Id: Ib30bec0d383f882dd2ad3b22a647e3257b2229f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295220
Commit-Queue: Tomek Jurkiewicz <[email protected]>
Reviewed-by: Mark Cogan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1111730}
diff --git a/ios/PRESUBMIT.py b/ios/PRESUBMIT.py
index fdbe15f..95455270 100644
--- a/ios/PRESUBMIT.py
+++ b/ios/PRESUBMIT.py
@@ -14,7 +14,7 @@
NULLABILITY_PATTERN = r'(nonnull|nullable|_Nullable|_Nonnull)'
TODO_PATTERN = r'TO[D]O\(([^\)]*)\)'
-CRBUG_PATTERN = r'crbug\.com/\d+$'
+BUG_PATTERN = r'(crbug\.com|b)/\d+$'
INCLUDE_PATTERN = r'^#include'
PIPE_IN_COMMENT_PATTERN = r'//.*[^|]\|(?!\|)'
IOS_PACKAGE_PATTERN = r'^ios'
@@ -181,13 +181,12 @@
def _HasToDoWithNoBug(input_api, line):
""" Returns True if TODO is not identified by a bug number."""
todo_regex = input_api.re.compile(TODO_PATTERN)
- crbug_regex = input_api.re.compile(CRBUG_PATTERN)
+ bug_regex = input_api.re.compile(BUG_PATTERN)
todo_match = todo_regex.search(line)
if not todo_match:
return False
- crbug_match = crbug_regex.match(todo_match.group(1))
- return not crbug_match
+ return not bug_regex.match(todo_match.group(1))
def _CheckHasNoBoxedBOOL(input_api, output_api):
""" Checks that there are no @(YES) or @(NO)."""