OLD | NEW |
(Empty) | |
| 1 # Copyright 2017 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 """Presubmit script for files in chrome/browser/ui/webui. |
| 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into depot_tools. |
| 9 """ |
| 10 |
| 11 |
| 12 def _CheckWebDevStyle(input_api, output_api): |
| 13 results = [] |
| 14 try: |
| 15 import sys |
| 16 old_sys_path = sys.path |
| 17 cwd = input_api.PresubmitLocalPath() |
| 18 sys.path += [input_api.os_path.join(cwd, '..', '..', '..', '..', 'tools')] |
| 19 import web_dev_style.presubmit_support |
| 20 results = web_dev_style.presubmit_support.CheckStyle(input_api, output_api) |
| 21 finally: |
| 22 sys.path = old_sys_path |
| 23 return results |
| 24 |
| 25 |
| 26 def CheckChangeOnUpload(input_api, output_api): |
| 27 return _CheckWebDevStyle(input_api, output_api) |
| 28 |
| 29 |
| 30 def CheckChangeOnCommit(input_api, output_api): |
| 31 return _CheckWebDevStyle(input_api, output_api) |
OLD | NEW |