| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 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 gcl. | 8 details on the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 output = [] | 25 output = [] |
| 26 # Verify that LocalPath() is local, e.g.: | 26 # Verify that LocalPath() is local, e.g.: |
| 27 # os.path.join(PresubmitLocalPath(), LocalPath()) == AbsoluteLocalPath() | 27 # os.path.join(PresubmitLocalPath(), LocalPath()) == AbsoluteLocalPath() |
| 28 for i in input_api.AffectedFiles(): | 28 for i in input_api.AffectedFiles(): |
| 29 if (input_api.os_path.join(input_api.PresubmitLocalPath(), i.LocalPath()) != | 29 if (input_api.os_path.join(input_api.PresubmitLocalPath(), i.LocalPath()) != |
| 30 i.AbsoluteLocalPath()): | 30 i.AbsoluteLocalPath()): |
| 31 output.append(output_api.PresubmitError('Path inconsistency')) | 31 output.append(output_api.PresubmitError('Path inconsistency')) |
| 32 # Return right away because it needs to be fixed first. | 32 # Return right away because it needs to be fixed first. |
| 33 return output | 33 return output |
| 34 | 34 |
| 35 # TODO(dpranke): uncomment and enable :). | 35 output.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) |
| 36 # | |
| 37 # output.extend(input_api.canned_checks.CheckOwners( | |
| 38 # input_api, | |
| 39 # output_api)) | |
| 40 | 36 |
| 41 output.extend(input_api.canned_checks.RunPythonUnitTests( | 37 output.extend(input_api.canned_checks.RunPythonUnitTests( |
| 42 input_api, | 38 input_api, |
| 43 output_api, | 39 output_api, |
| 44 UNIT_TESTS)) | 40 UNIT_TESTS)) |
| 45 output.extend(WasGitClUploadHookModified(input_api, output_api)) | 41 output.extend(WasGitClUploadHookModified(input_api, output_api)) |
| 46 | 42 |
| 47 white_list = [r'.*\.py$', r'^git-try$'] | 43 white_list = [r'.*\.py$', r'^git-try$'] |
| 48 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ | 44 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ |
| 49 r'^cpplint\.py$', | 45 r'^cpplint\.py$', |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 | 68 |
| 73 | 69 |
| 74 def WasGitClUploadHookModified(input_api, output_api): | 70 def WasGitClUploadHookModified(input_api, output_api): |
| 75 for affected_file in input_api.AffectedSourceFiles(None): | 71 for affected_file in input_api.AffectedSourceFiles(None): |
| 76 if (input_api.os_path.basename(affected_file.LocalPath()) == | 72 if (input_api.os_path.basename(affected_file.LocalPath()) == |
| 77 'git-cl-upload-hook'): | 73 'git-cl-upload-hook'): |
| 78 return [output_api.PresubmitPromptWarning( | 74 return [output_api.PresubmitPromptWarning( |
| 79 'Don\'t forget to fix git-cl to download the newest version of ' | 75 'Don\'t forget to fix git-cl to download the newest version of ' |
| 80 'git-cl-upload-hook')] | 76 'git-cl-upload-hook')] |
| 81 return [] | 77 return [] |
| OLD | NEW |