From e6f3d66bae371ddf8ccd91d26ec788dd75d3f5a7 Mon Sep 17 00:00:00 2001 From: Peter Kasting Date: Mon, 7 Nov 2022 22:57:33 +0000 Subject: [PATCH] Fix bad regex. This corrects an oversight in https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4004597 that led to IWYU zealously over-recommending #includes. Bug: chromium:1368812 Change-Id: Ic4b2f93271206be79371378038bdedd40f7079ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4010619 Auto-Submit: Peter Kasting Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak --- cpplint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpplint.py b/cpplint.py index 4ce789ecb..209c3ac38 100755 --- a/cpplint.py +++ b/cpplint.py @@ -5350,7 +5350,7 @@ for _header, _templates in _HEADERS_MAYBE_TEMPLATES: for _template in _templates: # Match max(..., ...), max(..., ...), but not foo->max or foo.max. _re_pattern_headers_maybe_templates.append( - (re.compile(r'(?.]\b)' + _template + r'(<.*?>)?\([^\)]'), _template, + (re.compile(r'(?.])\b' + _template + r'(<.*?>)?\([^\)]'), _template, _header)) # Other scripts may reach in and modify this pattern.