| 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 depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 files)] | 506 files)] |
| 507 return [] | 507 return [] |
| 508 | 508 |
| 509 | 509 |
| 510 def _CheckNoNewWStrings(input_api, output_api): | 510 def _CheckNoNewWStrings(input_api, output_api): |
| 511 """Checks to make sure we don't introduce use of wstrings.""" | 511 """Checks to make sure we don't introduce use of wstrings.""" |
| 512 problems = [] | 512 problems = [] |
| 513 for f in input_api.AffectedFiles(): | 513 for f in input_api.AffectedFiles(): |
| 514 if (not f.LocalPath().endswith(('.cc', '.h')) or | 514 if (not f.LocalPath().endswith(('.cc', '.h')) or |
| 515 f.LocalPath().endswith(('test.cc', '_win.cc', '_win.h')) or | 515 f.LocalPath().endswith(('test.cc', '_win.cc', '_win.h')) or |
| 516 '/win/' in f.LocalPath()): | 516 '/win/' in f.LocalPath() or |
| 517 'chrome_elf' in f.LocalPath() or |
| 518 'install_static' in f.LocalPath()): |
| 517 continue | 519 continue |
| 518 | 520 |
| 519 allowWString = False | 521 allowWString = False |
| 520 for line_num, line in f.ChangedContents(): | 522 for line_num, line in f.ChangedContents(): |
| 521 if 'presubmit: allow wstring' in line: | 523 if 'presubmit: allow wstring' in line: |
| 522 allowWString = True | 524 allowWString = True |
| 523 elif not allowWString and 'wstring' in line: | 525 elif not allowWString and 'wstring' in line: |
| 524 problems.append(' %s:%d' % (f.LocalPath(), line_num)) | 526 problems.append(' %s:%d' % (f.LocalPath(), line_num)) |
| 525 allowWString = False | 527 allowWString = False |
| 526 else: | 528 else: |
| (...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2218 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 2220 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 2219 input_api, | 2221 input_api, |
| 2220 output_api, | 2222 output_api, |
| 2221 json_url='http://chromium-status.appspot.com/current?format=json')) | 2223 json_url='http://chromium-status.appspot.com/current?format=json')) |
| 2222 | 2224 |
| 2223 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2225 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 2224 input_api, output_api)) | 2226 input_api, output_api)) |
| 2225 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2227 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 2226 input_api, output_api)) | 2228 input_api, output_api)) |
| 2227 return results | 2229 return results |
| OLD | NEW |