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

Side by Side Diff: ui/webui/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 | « components/version_ui/PRESUBMIT.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 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 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 def PostUploadHook(cl, change, output_api): 5 def PostUploadHook(cl, change, output_api):
6 return output_api.EnsureCQIncludeTrybotsAreAdded( 6 return output_api.EnsureCQIncludeTrybotsAreAdded(
7 cl, 7 cl,
8 [ 8 [
9 'master.tryserver.chromium.linux:closure_compilation', 9 'master.tryserver.chromium.linux:closure_compilation',
10 ], 10 ],
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 <cr-dialog>#closeText (http://bit.ly/2eLEsqh).""")] 54 <cr-dialog>#closeText (http://bit.ly/2eLEsqh).""")]
55 55
56 56
57 def _CommonChecks(input_api, output_api): 57 def _CommonChecks(input_api, output_api):
58 results = [] 58 results = []
59 results += _CheckForTranslations(input_api, output_api) 59 results += _CheckForTranslations(input_api, output_api)
60 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api, 60 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api,
61 check_js=True) 61 check_js=True)
62 try: 62 try:
63 import sys 63 import sys
64 old_sys_path = sys.path 64 old_sys_path = sys.path[:]
65 cwd = input_api.PresubmitLocalPath() 65 cwd = input_api.PresubmitLocalPath()
66 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')] 66 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')]
67 from web_dev_style import presubmit_support 67 from web_dev_style import presubmit_support
68 BLACKLIST = ['ui/webui/resources/js/analytics.js', 68 BLACKLIST = ['ui/webui/resources/js/analytics.js',
69 'ui/webui/resources/js/jstemplate_compiled.js'] 69 'ui/webui/resources/js/jstemplate_compiled.js']
70 file_filter = lambda f: f.LocalPath() not in BLACKLIST 70 file_filter = lambda f: f.LocalPath() not in BLACKLIST
71 results += presubmit_support.CheckStyle(input_api, output_api, file_filter) 71 results += presubmit_support.CheckStyle(input_api, output_api, file_filter)
72 finally: 72 finally:
73 sys.path = old_sys_path 73 sys.path = old_sys_path
74 return results 74 return results
OLDNEW
« no previous file with comments | « components/version_ui/PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698