| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 cc. | 5 """Top-level presubmit script for cc. |
| 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 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 # Checks for the use of cc:: within the cc namespace, which is usually | 240 # Checks for the use of cc:: within the cc namespace, which is usually |
| 241 # redundant. | 241 # redundant. |
| 242 def CheckNamespace(input_api, output_api): | 242 def CheckNamespace(input_api, output_api): |
| 243 errors = [] | 243 errors = [] |
| 244 | 244 |
| 245 source_file_filter = lambda x: x | 245 source_file_filter = lambda x: x |
| 246 for f in input_api.AffectedSourceFiles(source_file_filter): | 246 for f in input_api.AffectedSourceFiles(source_file_filter): |
| 247 contents = input_api.ReadFile(f, 'rb') | 247 contents = input_api.ReadFile(f, 'rb') |
| 248 match = re.search(r'namespace\s*cc\s*{', contents) | 248 match = re.search(r'namespace\s*cc\s*{', contents) |
| 249 if match: | 249 if match: |
| 250 whitelist = [ | 250 whitelist = [] |
| 251 r"cc::remove_if\b", | |
| 252 ] | |
| 253 if FindNamespaceInBlock(match.end(), 'cc', contents, whitelist=whitelist): | 251 if FindNamespaceInBlock(match.end(), 'cc', contents, whitelist=whitelist): |
| 254 errors.append(f.LocalPath()) | 252 errors.append(f.LocalPath()) |
| 255 | 253 |
| 256 if errors: | 254 if errors: |
| 257 return [output_api.PresubmitError( | 255 return [output_api.PresubmitError( |
| 258 'Do not use cc:: inside of the cc namespace.', | 256 'Do not use cc:: inside of the cc namespace.', |
| 259 items=errors)] | 257 items=errors)] |
| 260 return [] | 258 return [] |
| 261 | 259 |
| 262 def CheckForUseOfWrongClock(input_api, | 260 def CheckForUseOfWrongClock(input_api, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 results = [] | 352 results = [] |
| 355 new_description = description | 353 new_description = description |
| 356 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots_string_bits) | 354 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots_string_bits) |
| 357 results.append(output_api.PresubmitNotifyResult( | 355 results.append(output_api.PresubmitNotifyResult( |
| 358 'Automatically added Perf trybots to run Blink tests on CQ.')) | 356 'Automatically added Perf trybots to run Blink tests on CQ.')) |
| 359 | 357 |
| 360 if new_description != description: | 358 if new_description != description: |
| 361 rietveld_obj.update_description(issue, new_description) | 359 rietveld_obj.update_description(issue, new_description) |
| 362 | 360 |
| 363 return results | 361 return results |
| OLD | NEW |