Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Side by Side Diff: PRESUBMIT.py

Issue 22338004: Don't issue presubmit warning for use of wstrings in Windows-only files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tuple form of endswith Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 return [] 302 return []
303 return [output_api.PresubmitPromptWarning('UNIT_TEST is only for headers.\n' + 303 return [output_api.PresubmitPromptWarning('UNIT_TEST is only for headers.\n' +
304 '\n'.join(problems))] 304 '\n'.join(problems))]
305 305
306 306
307 def _CheckNoNewWStrings(input_api, output_api): 307 def _CheckNoNewWStrings(input_api, output_api):
308 """Checks to make sure we don't introduce use of wstrings.""" 308 """Checks to make sure we don't introduce use of wstrings."""
309 problems = [] 309 problems = []
310 for f in input_api.AffectedFiles(): 310 for f in input_api.AffectedFiles():
311 if (not f.LocalPath().endswith(('.cc', '.h')) or 311 if (not f.LocalPath().endswith(('.cc', '.h')) or
312 f.LocalPath().endswith('test.cc')): 312 f.LocalPath().endswith(('test.cc', '_win.cc', '_win.h'))):
313 continue 313 continue
314 314
315 allowWString = False 315 allowWString = False
316 for line_num, line in f.ChangedContents(): 316 for line_num, line in f.ChangedContents():
317 if 'presubmit: allow wstring' in line: 317 if 'presubmit: allow wstring' in line:
318 allowWString = True 318 allowWString = True
319 elif not allowWString and 'wstring' in line: 319 elif not allowWString and 'wstring' in line:
320 problems.append(' %s:%d' % (f.LocalPath(), line_num)) 320 problems.append(' %s:%d' % (f.LocalPath(), line_num))
321 allowWString = False 321 allowWString = False
322 else: 322 else:
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] 1054 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan']
1055 1055
1056 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it 1056 # The AOSP bot doesn't build the chrome/ layer, so ignore any changes to it
1057 # unless they're .gyp(i) files as changes to those files can break the gyp 1057 # unless they're .gyp(i) files as changes to those files can break the gyp
1058 # step on that bot. 1058 # step on that bot.
1059 if (not all(re.search('^chrome', f) for f in files) or 1059 if (not all(re.search('^chrome', f) for f in files) or
1060 any(re.search('\.gypi?$', f) for f in files)): 1060 any(re.search('\.gypi?$', f) for f in files)):
1061 trybots += ['android_aosp'] 1061 trybots += ['android_aosp']
1062 1062
1063 return trybots 1063 return trybots
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698