| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 """Top-level presubmit script for src/components/cronet. | 5 """Top-level presubmit script for src/components/cronet. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 def _PyLintChecks(input_api, output_api): |
| 12 pylint_checks = input_api.canned_checks.GetPylint(input_api, output_api, |
| 13 extra_paths_list=_GetPathsToPrepend(input_api), pylintrc='pylintrc') |
| 14 return input_api.RunTests(pylint_checks) |
| 15 |
| 16 def _GetPathsToPrepend(input_api): |
| 17 current_dir = input_api.PresubmitLocalPath() |
| 18 chromium_src_dir = input_api.os_path.join(current_dir, '..', '..') |
| 19 return [ |
| 20 input_api.os_path.join(current_dir, 'tools'), |
| 21 input_api.os_path.join(current_dir, 'android', 'test', 'javaperftests'), |
| 22 input_api.os_path.join(chromium_src_dir, 'tools', 'perf'), |
| 23 input_api.os_path.join(chromium_src_dir, 'build', 'android'), |
| 24 input_api.os_path.join(chromium_src_dir, 'build', 'android', 'gyp', 'util'), |
| 25 input_api.os_path.join(chromium_src_dir, 'net', 'tools', 'net_docs'), |
| 26 input_api.os_path.join(chromium_src_dir, 'tools'), |
| 27 input_api.os_path.join(chromium_src_dir, 'third_party'), |
| 28 input_api.os_path.join(chromium_src_dir, |
| 29 'third_party', 'catapult', 'telemetry'), |
| 30 input_api.os_path.join(chromium_src_dir, |
| 31 'third_party', 'catapult', 'devil'), |
| 32 ] |
| 33 |
| 11 def CheckChangeOnUpload(input_api, output_api): | 34 def CheckChangeOnUpload(input_api, output_api): |
| 12 return input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | 35 results = [] |
| 36 results.extend(_PyLintChecks(input_api, output_api)) |
| 37 results.extend( |
| 38 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) |
| 39 return results |
| OLD | NEW |