Commit 07a6bea9 authored by Takeshi Yoshino's avatar Takeshi Yoshino Committed by Commit Bot

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: 's avatarDirk Pranke <dpranke@chromium.org>
parent e864a3f2
......@@ -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',
......
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