blob: 5b4c471b83b7725533f82b391c3052bd668d5bad [file] [log] [blame]
dbeam229bcc242017-05-19 00:06:321# 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
6def _CommonChecks(input_api, output_api):
7 results = []
8 try:
9 import sys
dbeam574fe092017-05-25 00:21:3410 old_sys_path = sys.path[:]
dbeam229bcc242017-05-19 00:06:3211 cwd = input_api.PresubmitLocalPath()
12 sys.path += [input_api.os_path.join(cwd, '..', '..', 'tools')]
13 import web_dev_style.presubmit_support
14 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api)
15 finally:
16 sys.path = old_sys_path
17 return results
18
19
20def CheckChangeOnUpload(input_api, output_api):
21 return _CommonChecks(input_api, output_api)
22
23
24def CheckChangeOnCommit(input_api, output_api):
25 return _CommonChecks(input_api, output_api)