1# Copyright 2020 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/chrome/common/apps/platform_apps.
6
7See https://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