[test] Don't run presubmit over deleted files.

BUG=v8:5603
NOTRY=true

Review-Url: https://codereview.chromium.org/2534813002
Cr-Commit-Position: refs/heads/master@{#41297}
This commit is contained in:
machenbach 2016-11-28 00:30:09 -08:00 committed by Commit bot
parent e96076ee42
commit c69f8fbd78
2 changed files with 5 additions and 4 deletions

View File

@ -71,9 +71,11 @@ def _V8PresubmitChecks(input_api, output_api):
from presubmit import CheckStatusFiles
results = []
if not CppLintProcessor().RunOnFiles(input_api.AffectedFiles()):
if not CppLintProcessor().RunOnFiles(
input_api.AffectedFiles(include_deletes=False)):
results.append(output_api.PresubmitError("C++ lint check failed"))
if not SourceProcessor().RunOnFiles(input_api.AffectedFiles()):
if not SourceProcessor().RunOnFiles(
input_api.AffectedFiles(include_deletes=False)):
results.append(output_api.PresubmitError(
"Copyright header, trailing whitespaces and two empty lines " \
"between declarations check failed"))

View File

@ -179,8 +179,7 @@ class SourceFileProcessor(object):
all_files = [
f.AbsoluteLocalPath()
for f in files
if (os.path.isfile(f.AbsoluteLocalPath()) and
not self.IgnoreFile(f.LocalPath()) and
if (not self.IgnoreFile(f.LocalPath()) and
self.IsRelevant(f.LocalPath()) and
all(not self.IgnoreDir(d) for d in dirs(f.LocalPath())) and
any(map(f.LocalPath().startswith, search_paths)))