From 42a42a68bac5a033e3de285c435c280b7464ca6b Mon Sep 17 00:00:00 2001 From: Clemens Hammacher Date: Thu, 3 Jan 2019 14:11:38 +0100 Subject: [PATCH] [presubmit] Do not check for V8_NOEXCEPT in include/ We don't have our macros available there, so we should not enforce V8_NOEXCEPT on types declared in include/v8.h or other files in include/. R=mlippautz@chromium.org Bug: v8:8616 No-Try: true Change-Id: I51550a072a7957921c6cbd7e0866093f0462ff4e Reviewed-on: https://chromium-review.googlesource.com/c/1394547 Reviewed-by: Michael Lippautz Commit-Queue: Clemens Hammacher Cr-Commit-Position: refs/heads/master@{#58520} --- PRESUBMIT.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index a61402fdee..a093df492f 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -457,6 +457,12 @@ def _CheckNoexceptAnnotations(input_api, output_api): tools/presubmit.py (https://crbug.com/v8/8616). """ + def FilterFile(affected_file): + return input_api.FilterSourceFile( + affected_file, + white_list=(r'src/.*', r'test/.*')) + + # matches any class name. class_name = r'\b([A-Z][A-Za-z0-9_]*)(?:::\1)?' # initial class name is potentially followed by this to declare an assignment @@ -473,7 +479,8 @@ def _CheckNoexceptAnnotations(input_api, output_api): regexp = input_api.re.compile(full_pattern, re.MULTILINE) errors = [] - for f in input_api.AffectedFiles(include_deletes=False): + for f in input_api.AffectedFiles(file_filter=FilterFile, + include_deletes=False): with open(f.LocalPath()) as fh: for match in re.finditer(regexp, fh.read()): errors.append('in {}: {}'.format(f.LocalPath(),