| 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 Chromium. | 5 """Top-level presubmit script for Chromium. |
| 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 gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 # It loads the default black list (e.g. third_party, experimental, etc) and | 35 # It loads the default black list (e.g. third_party, experimental, etc) and |
| 36 # add our black list (breakpad, skia and v8 are still not following | 36 # add our black list (breakpad, skia and v8 are still not following |
| 37 # google style and are not really living this repository). | 37 # google style and are not really living this repository). |
| 38 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. | 38 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. |
| 39 black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS | 39 black_list = input_api.DEFAULT_BLACK_LIST + _EXCLUDED_PATHS |
| 40 white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES | 40 white_list = input_api.DEFAULT_WHITE_LIST + _TEXT_FILES |
| 41 sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) | 41 sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) |
| 42 text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, | 42 text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, |
| 43 white_list=white_list) | 43 white_list=white_list) |
| 44 results.extend(input_api.canned_checks.CheckLongLines( | 44 results.extend(input_api.canned_checks.CheckLongLines( |
| 45 input_api, output_api, sources)) | 45 input_api, output_api, source_file_filter=sources)) |
| 46 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( | 46 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
| 47 input_api, output_api, sources)) | 47 input_api, output_api, source_file_filter=sources)) |
| 48 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( | 48 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( |
| 49 input_api, output_api, sources)) | 49 input_api, output_api, source_file_filter=sources)) |
| 50 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 50 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 51 input_api, output_api)) | 51 input_api, output_api)) |
| 52 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 52 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
| 53 input_api, output_api)) | 53 input_api, output_api)) |
| 54 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( | 54 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( |
| 55 input_api, output_api, text_files)) | 55 input_api, output_api, source_file_filter=text_files)) |
| 56 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 56 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
| 57 input_api, output_api)) | 57 input_api, output_api)) |
| 58 results.extend(input_api.canned_checks.CheckLicense( | 58 results.extend(input_api.canned_checks.CheckLicense( |
| 59 input_api, output_api, _LICENSE_HEADER, sources)) | 59 input_api, output_api, _LICENSE_HEADER, source_file_filter=sources)) |
| 60 return results | 60 return results |
| 61 | 61 |
| 62 | 62 |
| 63 def CheckChangeOnUpload(input_api, output_api): | 63 def CheckChangeOnUpload(input_api, output_api): |
| 64 results = [] | 64 results = [] |
| 65 results.extend(_CommonChecks(input_api, output_api)) | 65 results.extend(_CommonChecks(input_api, output_api)) |
| 66 return results | 66 return results |
| 67 | 67 |
| 68 | 68 |
| 69 def CheckChangeOnCommit(input_api, output_api): | 69 def CheckChangeOnCommit(input_api, output_api): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 input_api, | 105 input_api, |
| 106 output_api, | 106 output_api, |
| 107 'http://build.chromium.org/buildbot/waterfall/json/builders?filter=1', | 107 'http://build.chromium.org/buildbot/waterfall/json/builders?filter=1', |
| 108 6, | 108 6, |
| 109 IGNORED_BUILDERS)) | 109 IGNORED_BUILDERS)) |
| 110 return results | 110 return results |
| 111 | 111 |
| 112 | 112 |
| 113 def GetPreferredTrySlaves(): | 113 def GetPreferredTrySlaves(): |
| 114 return ['win', 'linux', 'mac'] | 114 return ['win', 'linux', 'mac'] |
| OLD | NEW |