1# Copyright 2016 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""Chromium presubmit script for src/extensions/common. 6 7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 8for more details on the presubmit API built into depot_tools. 9""" 10 11import sys 12 13 14def _CheckExterns(input_api, output_api): 15 original_sys_path = sys.path 16 join = input_api.os_path.join 17 src_root = input_api.change.RepositoryRoot() 18 try: 19 sys.path.append(join(src_root, 'extensions', 'common', 'api')) 20 from externs_checker import ExternsChecker 21 finally: 22 sys.path = original_sys_path 23 24 return ExternsChecker(input_api, output_api).RunChecks() 25 26 27def CheckChangeOnUpload(input_api, output_api): 28 return _CheckExterns(input_api, output_api) 29