From 8eac0c622fef1b7311a19f201eb74298cda93279 Mon Sep 17 00:00:00 2001 From: Matthias Liedtke Date: Thu, 6 Jul 2023 08:09:07 +0000 Subject: [PATCH] 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 Commit-Queue: Matthias Liedtke --- cpplint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpplint.py b/cpplint.py index 0e7f4a8ef..60b9c2bf2 100755 --- a/cpplint.py +++ b/cpplint.py @@ -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):