Expose ast via InputApi

To be used by https://chromium-review.googlesource.com/c/593708/

Bug:
Change-Id: I0d005bf6a6ba4262197a222cb337308551ed61a6
Reviewed-on: https://chromium-review.googlesource.com/595308
Commit-Queue: Takeshi Yoshino <tyoshino@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
changes/08/595308/5
Takeshi Yoshino 8 years ago committed by Commit Bot
parent e864a3f217
commit 07a6bea90f

@ -12,6 +12,7 @@ __version__ = '1.8.0'
# caching (between all different invocations of presubmit scripts for a given
# change). We should add it as our presubmit scripts start feeling slow.
import ast # Exposed through the API.
import cpplint
import cPickle # Exposed through the API.
import cStringIO # Exposed through the API.
@ -402,6 +403,7 @@ class InputApi(object):
# We expose various modules and functions as attributes of the input_api
# so that presubmit scripts don't have to import them.
self.ast = ast
self.basename = os.path.basename
self.cPickle = cPickle
self.cpplint = cpplint

@ -160,7 +160,7 @@ class PresubmitUnittest(PresubmitTestsBase):
'GitChange', 'InputApi', 'ListRelevantPresubmitFiles', 'main',
'NonexistantCannedCheckFilter', 'OutputApi', 'ParseFiles',
'PresubmitFailure', 'PresubmitExecuter', 'PresubmitOutput', 'ScanSubDirs',
'auth', 'cPickle', 'cpplint', 'cStringIO', 'contextlib',
'ast', 'auth', 'cPickle', 'cpplint', 'cStringIO', 'contextlib',
'canned_check_filter', 'fix_encoding', 'fnmatch', 'gclient_utils',
'git_footers', 'glob', 'inspect', 'json', 'load_files', 'logging',
'marshal', 'normpath', 'optparse', 'os', 'owners', 'owners_finder',
@ -960,6 +960,7 @@ class InputApiUnittest(PresubmitTestsBase):
'ReadFile',
'RightHandSideLines',
'ShutdownPool',
'ast',
'basename',
'cPickle',
'cpplint',

Loading…
Cancel
Save