Commit 095fe782 authored by Laís Minchillo's avatar Laís Minchillo Committed by Commit Bot

[aw] Change DEV_SUFFIX presubmit check to pattern

Change DEV_SUFFIX presubmit check to use the pattern
'\bDEV_SUFFIX\b' instead of searching for the raw
string 'DEV_SUFFIX'. This can potentially avoid some
false positives.

boundary_interfaces no longer triggers a false positive.

Bug: 921784
Test: Locally adding SOME_DEV_SUFFIX or DEV_SUFFIX_SOME in
Change-Id: I5a9d6b04182ec8ebcbb3e6d9eba3f757da0c0847
Reviewed-on: https://chromium-review.googlesource.com/c/1436032
Commit-Queue: Laís Minchillo <laisminchillo@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626976}
parent 1d84cbe0
...@@ -63,11 +63,14 @@ def _CheckFeatureDevSuffix(input_api, output_api): ...@@ -63,11 +63,14 @@ def _CheckFeatureDevSuffix(input_api, output_api):
right place to use it is SupportLibWebViewChromiumFactory. right place to use it is SupportLibWebViewChromiumFactory.
""" """
pattern = input_api.re.compile(r'\bDEV_SUFFIX\b')
problems = [] problems = []
filt = lambda f: 'boundary_interfaces' in f.LocalPath() filt = lambda f: 'boundary_interfaces' in f.LocalPath()
for f in input_api.AffectedFiles(file_filter=filt): for f in input_api.AffectedFiles(file_filter=filt):
for line_num, line in f.ChangedContents(): for line_num, line in f.ChangedContents():
if 'DEV_SUFFIX' in line: m = pattern.search(line)
if m:
problems.append(' %s:%d\n %s\n' % (f.LocalPath(), line_num, line)) problems.append(' %s:%d\n %s\n' % (f.LocalPath(), line_num, line))
if not problems: if not problems:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment