Update TODO pattern to not match other names
We plan on introducing a TODOC marker in v8.
(This is similar to a TODO but as a note to document something.)
At the current state the linter complains on lines like:
// TODOC: [...]
claiming that the TODO misses a username.
We'd like our new marker not to require a username.
The new regex is a merge of the existing regex with the updated
regex in the google-internal source this script is based on.
Change-Id: Ib792c82a9d62e45ef7994beab3fb3f48d7241292
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4660911
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
diff --git a/cpplint.py b/cpplint.py
index 0e7f4a8..60b9c2b 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -3300,7 +3300,8 @@
function_state.Count() # Count non-blank/non-comment lines.
-_RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')
+_RE_PATTERN_TODO = re.compile(
+ r'^//(\s*)TODO(?:(\(.+?\)):?|:|)(\s|$|[A-Z]*[a-z])')
def CheckComment(line, filename, linenum, next_line_start, error):