| 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 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 return [] | 354 return [] |
| 355 return [output_api.PresubmitPromptWarning('UNIT_TEST is only for headers.\n' + | 355 return [output_api.PresubmitPromptWarning('UNIT_TEST is only for headers.\n' + |
| 356 '\n'.join(problems))] | 356 '\n'.join(problems))] |
| 357 | 357 |
| 358 | 358 |
| 359 def _CheckNoNewWStrings(input_api, output_api): | 359 def _CheckNoNewWStrings(input_api, output_api): |
| 360 """Checks to make sure we don't introduce use of wstrings.""" | 360 """Checks to make sure we don't introduce use of wstrings.""" |
| 361 problems = [] | 361 problems = [] |
| 362 for f in input_api.AffectedFiles(): | 362 for f in input_api.AffectedFiles(): |
| 363 if (not f.LocalPath().endswith(('.cc', '.h')) or | 363 if (not f.LocalPath().endswith(('.cc', '.h')) or |
| 364 f.LocalPath().endswith(('test.cc', '_win.cc', '_win.h'))): | 364 f.LocalPath().endswith(('test.cc', '_win.cc', '_win.h')) or |
| 365 '/win/' in f.LocalPath()): |
| 365 continue | 366 continue |
| 366 | 367 |
| 367 allowWString = False | 368 allowWString = False |
| 368 for line_num, line in f.ChangedContents(): | 369 for line_num, line in f.ChangedContents(): |
| 369 if 'presubmit: allow wstring' in line: | 370 if 'presubmit: allow wstring' in line: |
| 370 allowWString = True | 371 allowWString = True |
| 371 elif not allowWString and 'wstring' in line: | 372 elif not allowWString and 'wstring' in line: |
| 372 problems.append(' %s:%d' % (f.LocalPath(), line_num)) | 373 problems.append(' %s:%d' % (f.LocalPath(), line_num)) |
| 373 allowWString = False | 374 allowWString = False |
| 374 else: | 375 else: |
| (...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 builders.extend(['cros_x86']) | 1746 builders.extend(['cros_x86']) |
| 1746 | 1747 |
| 1747 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it | 1748 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it |
| 1748 # unless they're .gyp(i) files as changes to those files can break the gyp | 1749 # unless they're .gyp(i) files as changes to those files can break the gyp |
| 1749 # step on that bot. | 1750 # step on that bot. |
| 1750 if (not all(re.search('^chrome', f) for f in files) or | 1751 if (not all(re.search('^chrome', f) for f in files) or |
| 1751 any(re.search('\.gypi?$', f) for f in files)): | 1752 any(re.search('\.gypi?$', f) for f in files)): |
| 1752 builders.extend(['android_aosp']) | 1753 builders.extend(['android_aosp']) |
| 1753 | 1754 |
| 1754 return GetDefaultTryConfigs(builders) | 1755 return GetDefaultTryConfigs(builders) |
| OLD | NEW |