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

Side by Side Diff: extensions/common/permissions/PRESUBMIT.py

Issue 170233008: Add presubmit check and automatic update script for ExtensionPermission enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
OLDNEW
(Empty)
1 # Copyright (c) 2014 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/permissions.
6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details on the presubmit API built into gcl.
9 """
10 import sys
11
12 def GetPreferredTrySlaves():
13 return ['linux_chromeos']
14
15 def _CheckPermissionMessageEnumValue(input_api, output_api):
16 LOCAL_PATH = "extensions/common/permissions/permission_message.h"
17 ENUM_START_MARKER = "enum ID {"
18 ENUM_END_MARKER = " kEnumBoundary"
19 original_sys_path = sys.path
20
21 try:
22 sys.path = sys.path + [input_api.os_path.join(
23 input_api.PresubmitLocalPath(), '../../../', 'tools', 'extra_imports')]
24 from strict_enum_value_checker import StrictEnumValueChecker
25 finally:
26 sys.path = original_sys_path
27
28 return StrictEnumValueChecker(input_api, output_api, ENUM_START_MARKER,
Jeffrey Yasskin 2014/02/20 19:07:36 Same comments about the function call style and 'r
29 ENUM_END_MARKER, LOCAL_PATH)
30
31 def CheckChangeOnUpload(input_api, output_api):
32 results = []
33 results += _CheckPermissionMessageEnumValue(input_api, output_api).Run()
rpaquay 2014/02/18 21:39:26 nit: same remark as other file wrt to naming. Mayb
34 return results
35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698