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 <pkasting@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/19/4010619/2
Peter Kasting 3 years ago committed by LUCI CQ
parent d9db3f6fd8
commit e6f3d66bae

2
cpplint.py vendored

@ -5350,7 +5350,7 @@ for _header, _templates in _HEADERS_MAYBE_TEMPLATES:
for _template in _templates:
# Match max<type>(..., ...), 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.

Loading…
Cancel
Save