| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 depot tools. | 5 """Top-level presubmit script for depot tools. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
| 8 details on the presubmit API built into depot_tools. | 8 details on the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) | 26 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) |
| 27 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ | 27 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ |
| 28 r'^cpplint\.py$', | 28 r'^cpplint\.py$', |
| 29 r'^python_bin[\/\\].+', | 29 r'^python_bin[\/\\].+', |
| 30 r'^svn_bin[\/\\].+', | 30 r'^svn_bin[\/\\].+', |
| 31 r'^tests[\/\\]\w+?[\/\\].+'] | 31 r'^tests[\/\\]\w+?[\/\\].+'] |
| 32 results.extend(input_api.canned_checks.RunPylint( | 32 results.extend(input_api.canned_checks.RunPylint( |
| 33 input_api, | 33 input_api, |
| 34 output_api, | 34 output_api, |
| 35 white_list=[r'.*\.py$', r'^git-try$'], | 35 white_list=[r'.*\.py$'], |
| 36 black_list=black_list)) | 36 black_list=black_list)) |
| 37 | 37 |
| 38 # TODO(maruel): Make sure at least one file is modified first. | 38 # TODO(maruel): Make sure at least one file is modified first. |
| 39 # TODO(maruel): If only tests are modified, only run them. | 39 # TODO(maruel): If only tests are modified, only run them. |
| 40 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 40 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
| 41 input_api, | 41 input_api, |
| 42 output_api, | 42 output_api, |
| 43 'tests', | 43 'tests', |
| 44 whitelist=[r'.*test\.py$'])) | 44 whitelist=[r'.*test\.py$'])) |
| 45 results.extend(RunGitClTests(input_api, output_api)) | 45 results.extend(RunGitClTests(input_api, output_api)) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return CommonChecks(input_api, output_api) | 98 return CommonChecks(input_api, output_api) |
| 99 | 99 |
| 100 | 100 |
| 101 def CheckChangeOnCommit(input_api, output_api): | 101 def CheckChangeOnCommit(input_api, output_api): |
| 102 output = [] | 102 output = [] |
| 103 output.extend(CommonChecks(input_api, output_api)) | 103 output.extend(CommonChecks(input_api, output_api)) |
| 104 output.extend(input_api.canned_checks.CheckDoNotSubmit( | 104 output.extend(input_api.canned_checks.CheckDoNotSubmit( |
| 105 input_api, | 105 input_api, |
| 106 output_api)) | 106 output_api)) |
| 107 return output | 107 return output |
| OLD | NEW |