Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: chrome/common/extensions/api/PRESUBMIT.py

Issue 1761663002: [Closure Externs] Add more APIs to the presubmit warning list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fixes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | extensions/common/api/externs_checker.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details on the presubmit API built into depot_tools.
9 """
10
11 import sys
12
13
14 def _CheckExterns(input_api, output_api):
15 original_sys_path = sys.path
16
17 join = input_api.os_path.join
18 api_root = input_api.PresubmitLocalPath()
19 src_root = join(api_root, '..', '..', '..', '..')
20 try:
21 sys.path.append(join(src_root, 'extensions', 'common', 'api'))
22 from externs_checker import ExternsChecker
23 finally:
24 sys.path = original_sys_path
25
26 externs_root = join(src_root, 'third_party', 'closure_compiler', 'externs')
27
28 api_pair_names = {
29 'autofill_private.idl': 'autofill_private.js',
30 'developer_private.idl': 'developer_private.js',
31 'bookmark_manager_private.json': 'bookmark_manager_private.js',
32 'command_line_private.json': 'command_line_private.js',
33 'file_manager_private.idl': 'file_manager_private.js',
34 'language_settings_private.idl': 'language_settings_private.js',
35 'metrics_private.json': 'metrics_private.js',
36 'passwords_private.idl': 'passwords_private.js',
37 'system_private.json': 'system_private.js',
38 'users_private.idl': 'users_private.js',
39 # TODO(rdevlin.cronin): Add more!
40 }
41 normpath = input_api.os_path.normpath
42 api_pairs = {
43 normpath(join(api_root, k)):
44 normpath(join(externs_root, v)) for k, v in api_pair_names.items()
45 }
46
47 return ExternsChecker(input_api, output_api, api_pairs).RunChecks()
48
49
50 def CheckChangeOnUpload(input_api, output_api):
51 return _CheckExterns(input_api, output_api)
OLDNEW
« no previous file with comments | « no previous file | extensions/common/api/externs_checker.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698