OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import os | 4 import os |
5 import sys | 5 import sys |
6 | 6 |
7 PYLINT_BLACKLIST = [] | 7 PYLINT_BLACKLIST = [] |
8 PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101'] | 8 PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101'] |
9 | 9 |
10 def _CommonChecks(input_api, output_api): | 10 def _CommonChecks(input_api, output_api): |
11 results = [] | 11 results = [] |
12 old_sys_path = sys.path | 12 old_sys_path = sys.path |
13 try: | 13 try: |
14 sys.path = [os.path.join('..', 'chrome_remote_control')] + sys.path | 14 sys.path = [os.path.join('..', 'telemetry')] + sys.path |
15 results.extend(input_api.canned_checks.RunPylint( | 15 results.extend(input_api.canned_checks.RunPylint( |
16 input_api, output_api, | 16 input_api, output_api, |
17 black_list=PYLINT_BLACKLIST, | 17 black_list=PYLINT_BLACKLIST, |
18 disabled_warnings=PYLINT_DISABLED_WARNINGS)) | 18 disabled_warnings=PYLINT_DISABLED_WARNINGS)) |
19 finally: | 19 finally: |
20 sys.path = old_sys_path | 20 sys.path = old_sys_path |
21 | 21 |
22 | 22 |
23 | 23 |
24 return results | 24 return results |
25 | 25 |
26 def CheckChangeOnUpload(input_api, output_api): | 26 def CheckChangeOnUpload(input_api, output_api): |
27 report = [] | 27 report = [] |
28 report.extend(_CommonChecks(input_api, output_api)) | 28 report.extend(_CommonChecks(input_api, output_api)) |
29 return report | 29 return report |
30 | 30 |
31 def CheckChangeOnCommit(input_api, output_api): | 31 def CheckChangeOnCommit(input_api, output_api): |
32 report = [] | 32 report = [] |
33 report.extend(_CommonChecks(input_api, output_api)) | 33 report.extend(_CommonChecks(input_api, output_api)) |
34 return report | 34 return report |
OLD | NEW |