OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 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 |
| 6 def _CommonChecks(input_api, output_api): |
| 7 results = [] |
| 8 |
| 9 pylint_checks = input_api.canned_checks.GetPylint( |
| 10 input_api, output_api, extra_paths_list=_GetPathsToPrepend(input_api), |
| 11 pylintrc='pylintrc') |
| 12 |
| 13 results.extend(input_api.RunTests(pylint_checks)) |
| 14 return results |
| 15 |
| 16 |
| 17 def _GetPathsToPrepend(input_api): |
| 18 telemetry_dir = input_api.PresubmitLocalPath() |
| 19 chromium_src_dir = input_api.os_path.join( |
| 20 input_api.PresubmitLocalPath(), '..', '..', '..', 'tools', 'telemetry') |
| 21 return [ |
| 22 input_api.os_path.join(telemetry_dir, 'telemetry'), |
| 23 input_api.os_path.join(telemetry_dir, 'third_party', 'mock'), |
| 24 ] |
| 25 |
| 26 |
| 27 def CheckChangeOnUpload(input_api, output_api): |
| 28 results = [] |
| 29 results.extend(_CommonChecks(input_api, output_api)) |
| 30 return results |
| 31 |
| 32 |
| 33 def CheckChangeOnCommit(input_api, output_api): |
| 34 results = [] |
| 35 results.extend(_CommonChecks(input_api, output_api)) |
| 36 return results |
OLD | NEW |