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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 # return scoped_ptr<T>(foo); | 163 # return scoped_ptr<T>(foo); |
164 # bar = scoped_ptr<T>(foo); | 164 # bar = scoped_ptr<T>(foo); |
165 # But allow: | 165 # But allow: |
166 # return scoped_ptr<T[]>(foo); | 166 # return scoped_ptr<T[]>(foo); |
167 # bar = scoped_ptr<T[]>(foo); | 167 # bar = scoped_ptr<T[]>(foo); |
168 if re.search(r'(=|\breturn)\s*scoped_ptr<.*?(?<!])>\([^)]+\)', line): | 168 if re.search(r'(=|\breturn)\s*scoped_ptr<.*?(?<!])>\([^)]+\)', line): |
169 errors.append(output_api.PresubmitError( | 169 errors.append(output_api.PresubmitError( |
170 ('%s:%d uses explicit scoped_ptr constructor. ' + | 170 ('%s:%d uses explicit scoped_ptr constructor. ' + |
171 'Use make_scoped_ptr() instead.') % (f.LocalPath(), line_number))) | 171 'Use make_scoped_ptr() instead.') % (f.LocalPath(), line_number))) |
172 # Disallow: | 172 # Disallow: |
173 # return scoped_ptr<T>(); | 173 # scoped_ptr<T>() |
174 # bar = scoped_ptr<T>(); | 174 if re.search(r'\bscoped_ptr<.*?>\(\)', line): |
175 if re.search(r'(=|\breturn)\s*scoped_ptr<.*?>\(\)', line): | |
176 errors.append(output_api.PresubmitError( | 175 errors.append(output_api.PresubmitError( |
177 '%s:%d uses scoped_ptr<T>(). Use nullptr instead.' % | 176 '%s:%d uses scoped_ptr<T>(). Use nullptr instead.' % |
178 (f.LocalPath(), line_number))) | 177 (f.LocalPath(), line_number))) |
179 # Disallow: | 178 # Disallow: |
180 # foo.PassAs<T>(); | 179 # foo.PassAs<T>(); |
181 if re.search(r'\bPassAs<.*?>\(\)', line): | 180 if re.search(r'\bPassAs<.*?>\(\)', line): |
182 errors.append(output_api.PresubmitError( | 181 errors.append(output_api.PresubmitError( |
183 '%s:%d uses PassAs<T>(). Use Pass() instead.' % | 182 '%s:%d uses PassAs<T>(). Use Pass() instead.' % |
184 (f.LocalPath(), line_number))) | 183 (f.LocalPath(), line_number))) |
185 return errors | 184 return errors |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 return { | 371 return { |
373 'tryserver.blink': { | 372 'tryserver.blink': { |
374 'linux_blink_rel': set(['defaulttests']), | 373 'linux_blink_rel': set(['defaulttests']), |
375 }, | 374 }, |
376 'tryserver.chromium.gpu': { | 375 'tryserver.chromium.gpu': { |
377 'linux_gpu': set(['defaulttests']), | 376 'linux_gpu': set(['defaulttests']), |
378 'mac_gpu': set(['defaulttests']), | 377 'mac_gpu': set(['defaulttests']), |
379 'win_gpu': set(['defaulttests']), | 378 'win_gpu': set(['defaulttests']), |
380 }, | 379 }, |
381 } | 380 } |
OLD | NEW |