Chromium Code Reviews| Index: extensions/common/api/PRESUBMIT.py |
| diff --git a/extensions/common/api/PRESUBMIT.py b/extensions/common/api/PRESUBMIT.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f06355571d5aa309836566d8d826b6d088e3e207 |
| --- /dev/null |
| +++ b/extensions/common/api/PRESUBMIT.py |
| @@ -0,0 +1,35 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Chromium presubmit script for src/extensions/common. |
| + |
| +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| +for more details on the presubmit API built into depot_tools. |
| +""" |
| + |
| +import sys |
| + |
| +def _CheckExterns(input_api, output_api): |
| + original_sys_path = sys.path |
| + |
| + try: |
| + sys.path.append(input_api.PresubmitLocalPath()) |
| + from externs_checker import ExternsChecker |
| + finally: |
| + sys.path = original_sys_path |
| + |
| + join = input_api.os_path.join |
| + api_root = input_api.PresubmitLocalPath() |
| + externs_root = join( |
| + input_api.PresubmitLocalPath(), '..', '..', '..', 'ui', 'externs') |
|
Dan Beam
2016/02/23 23:26:17
externs_root = join(api_root, '..', '..', '..', 'u
Devlin
2016/02/24 00:05:05
Whoops, done.
|
| + |
| + api_pairs = { |
| + join(api_root, 'bluetooth.idl'): join(externs_root, 'bluetooth.js'), |
| + #TODO(devlin): Add more! |
|
Dan Beam
2016/02/23 23:26:17
nit: # TODO(rdevlin.cronin):
Devlin
2016/02/24 00:05:05
I know it's unusual, but I use devlin just about e
Dan Beam
2016/02/24 00:15:31
you should change TODO(devlin) to TODO(rdevlin.cro
Devlin
2016/02/24 00:24:23
Changed here.
Devlin
2016/02/24 00:27:30
For reference, the reasons I prefer devlin are:
-
|
| + } |
| + |
| + return ExternsChecker(input_api, output_api, api_pairs).RunChecks() |
| + |
| +def CheckChangeOnUpload(input_api, output_api): |
| + return _CheckExterns(input_api, output_api) |