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

Side by Side Diff: chrome/browser/resources/PRESUBMIT.py

Issue 2897403003: web_dev_style: actually restore sys.path in various PRESUBMITs (Closed)
Patch Set: Created 3 years, 6 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 | components/about_ui/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Presubmit script for files in chrome/browser/resources. 5 """Presubmit script for files in chrome/browser/resources.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into depot_tools. 8 for more details about the presubmit API built into depot_tools.
9 """ 9 """
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 presubmit_path = input_api.PresubmitLocalPath() 100 presubmit_path = input_api.PresubmitLocalPath()
101 tests = [input_api.os_path.join(presubmit_path, 'vulcanize_gn_test.py')] 101 tests = [input_api.os_path.join(presubmit_path, 'vulcanize_gn_test.py')]
102 return input_api.canned_checks.RunUnitTests(input_api, output_api, tests) 102 return input_api.canned_checks.RunUnitTests(input_api, output_api, tests)
103 103
104 104
105 def _CheckWebDevStyle(input_api, output_api): 105 def _CheckWebDevStyle(input_api, output_api):
106 results = [] 106 results = []
107 107
108 try: 108 try:
109 import sys 109 import sys
110 old_sys_path = sys.path 110 old_sys_path = sys.path[:]
111 cwd = input_api.PresubmitLocalPath() 111 cwd = input_api.PresubmitLocalPath()
112 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')] 112 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')]
113 import web_dev_style.presubmit_support 113 import web_dev_style.presubmit_support
114 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api) 114 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api)
115 finally: 115 finally:
116 sys.path = old_sys_path 116 sys.path = old_sys_path
117 117
118 return results 118 return results
119 119
120 120
(...skipping 16 matching lines...) Expand all
137 return _CheckChangeOnUploadOrCommit(input_api, output_api) 137 return _CheckChangeOnUploadOrCommit(input_api, output_api)
138 138
139 139
140 def PostUploadHook(cl, change, output_api): 140 def PostUploadHook(cl, change, output_api):
141 return output_api.EnsureCQIncludeTrybotsAreAdded( 141 return output_api.EnsureCQIncludeTrybotsAreAdded(
142 cl, 142 cl,
143 [ 143 [
144 'master.tryserver.chromium.linux:closure_compilation', 144 'master.tryserver.chromium.linux:closure_compilation',
145 ], 145 ],
146 'Automatically added optional Closure bots to run on CQ.') 146 'Automatically added optional Closure bots to run on CQ.')
OLDNEW
« no previous file with comments | « no previous file | components/about_ui/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698