OLD | NEW |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 '#include <ostream>. See http://crbug.com/94794', | 108 '#include <ostream>. See http://crbug.com/94794', |
109 files) ] | 109 files) ] |
110 return [] | 110 return [] |
111 | 111 |
112 | 112 |
113 def _CheckNoNewWStrings(input_api, output_api): | 113 def _CheckNoNewWStrings(input_api, output_api): |
114 """Checks to make sure we don't introduce use of wstrings.""" | 114 """Checks to make sure we don't introduce use of wstrings.""" |
115 errors = [] | 115 errors = [] |
116 for f in input_api.AffectedFiles(): | 116 for f in input_api.AffectedFiles(): |
117 for line_num, line in f.ChangedContents(): | 117 for line_num, line in f.ChangedContents(): |
118 if not f.LocalPath().endswith(('.cc', '.h')): | 118 if (not f.LocalPath().endswith(('.cc', '.h')) or |
| 119 f.LocalPath().endswith('test.cc')): |
119 continue | 120 continue |
120 | 121 |
121 if 'wstring' in line: | 122 if 'wstring' in line: |
122 errors.append(output_api.PresubmitError( | 123 errors.append(output_api.PresubmitError( |
123 '%s, line %d: new code should not use wstrings. If you are ' | 124 '%s, line %d: new code should not use wstrings. If you are ' |
124 'calling an API that accepts a wstring, fix the API.' | 125 'calling an API that accepts a wstring, fix the API.' |
125 % (f.LocalPath(), line_num))) | 126 % (f.LocalPath(), line_num))) |
126 | 127 |
127 return errors | 128 return errors |
128 | 129 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 240 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
240 input_api, output_api)) | 241 input_api, output_api)) |
241 results.extend(input_api.canned_checks.CheckChangeHasTestField( | 242 results.extend(input_api.canned_checks.CheckChangeHasTestField( |
242 input_api, output_api)) | 243 input_api, output_api)) |
243 results.extend(_CheckSubversionConfig(input_api, output_api)) | 244 results.extend(_CheckSubversionConfig(input_api, output_api)) |
244 return results | 245 return results |
245 | 246 |
246 | 247 |
247 def GetPreferredTrySlaves(): | 248 def GetPreferredTrySlaves(): |
248 return ['win', 'linux', 'mac'] | 249 return ['win', 'linux', 'mac'] |
OLD | NEW |