Commit 16162377 authored by John Budorick's avatar John Budorick Committed by Commit Bot

presubmit: don't attempt to verify nonexistent vpython specs.

Bug: 834180
Change-Id: I431431e4fdf99c16c5fc3dbc7ed999b0c8da24bc
Reviewed-on: https://chromium-review.googlesource.com/1016690Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
parent 9ccad568
...@@ -1157,7 +1157,7 @@ def CheckVPythonSpec(input_api, output_api, file_filter=None): ...@@ -1157,7 +1157,7 @@ def CheckVPythonSpec(input_api, output_api, file_filter=None):
A list of input_api.Command objects containing verification commands. A list of input_api.Command objects containing verification commands.
""" """
file_filter = file_filter or (lambda f: f.LocalPath().endswith('.vpython')) file_filter = file_filter or (lambda f: f.LocalPath().endswith('.vpython'))
affected_files = input_api.AffectedFiles(file_filter=file_filter) affected_files = input_api.AffectedTestableFiles(file_filter=file_filter)
affected_files = map(lambda f: f.AbsoluteLocalPath(), affected_files) affected_files = map(lambda f: f.AbsoluteLocalPath(), affected_files)
commands = [] commands = []
......
...@@ -654,7 +654,7 @@ class InputApi(object): ...@@ -654,7 +654,7 @@ class InputApi(object):
"""Returns absolute local paths of input_api.AffectedFiles().""" """Returns absolute local paths of input_api.AffectedFiles()."""
return [af.AbsoluteLocalPath() for af in self.AffectedFiles()] return [af.AbsoluteLocalPath() for af in self.AffectedFiles()]
def AffectedTestableFiles(self, include_deletes=None): def AffectedTestableFiles(self, include_deletes=None, **kwargs):
"""Same as input_api.change.AffectedTestableFiles() except only lists files """Same as input_api.change.AffectedTestableFiles() except only lists files
in the same directory as the current presubmit script, or subdirectories in the same directory as the current presubmit script, or subdirectories
thereof. thereof.
...@@ -665,7 +665,7 @@ class InputApi(object): ...@@ -665,7 +665,7 @@ class InputApi(object):
category=DeprecationWarning, category=DeprecationWarning,
stacklevel=2) stacklevel=2)
return filter(lambda x: x.IsTestableFile(), return filter(lambda x: x.IsTestableFile(),
self.AffectedFiles(include_deletes=False)) self.AffectedFiles(include_deletes=False, **kwargs))
def AffectedTextFiles(self, include_deletes=None): def AffectedTextFiles(self, include_deletes=None):
"""An alias to AffectedTestableFiles for backwards compatibility.""" """An alias to AffectedTestableFiles for backwards compatibility."""
...@@ -1124,7 +1124,7 @@ class Change(object): ...@@ -1124,7 +1124,7 @@ class Change(object):
return affected return affected
return filter(lambda x: x.Action() != 'D', affected) return filter(lambda x: x.Action() != 'D', affected)
def AffectedTestableFiles(self, include_deletes=None): def AffectedTestableFiles(self, include_deletes=None, **kwargs):
"""Return a list of the existing text files in a change.""" """Return a list of the existing text files in a change."""
if include_deletes is not None: if include_deletes is not None:
warn("AffectedTeestableFiles(include_deletes=%s)" warn("AffectedTeestableFiles(include_deletes=%s)"
...@@ -1132,7 +1132,7 @@ class Change(object): ...@@ -1132,7 +1132,7 @@ class Change(object):
category=DeprecationWarning, category=DeprecationWarning,
stacklevel=2) stacklevel=2)
return filter(lambda x: x.IsTestableFile(), return filter(lambda x: x.IsTestableFile(),
self.AffectedFiles(include_deletes=False)) self.AffectedFiles(include_deletes=False, **kwargs))
def AffectedTextFiles(self, include_deletes=None): def AffectedTextFiles(self, include_deletes=None):
"""An alias to AffectedTestableFiles for backwards compatibility.""" """An alias to AffectedTestableFiles for backwards compatibility."""
......
...@@ -2851,7 +2851,7 @@ class CannedChecksUnittest(PresubmitTestsBase): ...@@ -2851,7 +2851,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
affected_file = self.mox.CreateMock(presubmit.GitAffectedFile) affected_file = self.mox.CreateMock(presubmit.GitAffectedFile)
affected_file.AbsoluteLocalPath().AndReturn('/path1/to/.vpython') affected_file.AbsoluteLocalPath().AndReturn('/path1/to/.vpython')
input_api.AffectedFiles( input_api.AffectedTestableFiles(
file_filter=mox.IgnoreArg()).AndReturn([affected_file]) file_filter=mox.IgnoreArg()).AndReturn([affected_file])
self.mox.ReplayAll() self.mox.ReplayAll()
......
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