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>
changes/11/4660911/3
Matthias Liedtke 2 years ago committed by LUCI CQ
parent 6fdc2131f9
commit 8eac0c622f

3
cpplint.py vendored

@ -3300,7 +3300,8 @@ def CheckForFunctionLengths(filename, clean_lines, linenum,
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):

Loading…
Cancel
Save