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

Side by Side Diff: PRESUBMIT.py

Issue 10824166: Cleaned up usage of std::wstring in src/remoting. Added presubmit warning supressions for the reman… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: string16 is not in std. Created 8 years, 4 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 | remoting/base/breakpad_win.cc » ('j') | remoting/host/host_event_logger_win.cc » ('J')
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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 286
287 def _CheckNoNewWStrings(input_api, output_api): 287 def _CheckNoNewWStrings(input_api, output_api):
288 """Checks to make sure we don't introduce use of wstrings.""" 288 """Checks to make sure we don't introduce use of wstrings."""
289 problems = [] 289 problems = []
290 for f in input_api.AffectedFiles(): 290 for f in input_api.AffectedFiles():
291 if (not f.LocalPath().endswith(('.cc', '.h')) or 291 if (not f.LocalPath().endswith(('.cc', '.h')) or
292 f.LocalPath().endswith('test.cc')): 292 f.LocalPath().endswith('test.cc')):
293 continue 293 continue
294 294
295 supressed = False
Wez 2012/08/03 21:26:15 typo: suppressed I'd suggest calling this allowWS
alexeypa (please no reviews) 2012/08/03 22:00:18 Done.
295 for line_num, line in f.ChangedContents(): 296 for line_num, line in f.ChangedContents():
296 if 'wstring' in line: 297 if 'presubmit: allow wstring' in line:
298 supressed = True
299 elif not supressed and 'wstring' in line:
297 problems.append(' %s:%d' % (f.LocalPath(), line_num)) 300 problems.append(' %s:%d' % (f.LocalPath(), line_num))
301 supressed = False
302 else:
303 supressed = False
298 304
299 if not problems: 305 if not problems:
300 return [] 306 return []
301 return [output_api.PresubmitPromptWarning('New code should not use wstrings.' 307 return [output_api.PresubmitPromptWarning('New code should not use wstrings.'
302 ' If you are calling an API that accepts a wstring, fix the API.\n' + 308 ' If you are calling a cross-platform API that accepts a wstring, '
309 'fix the API.\n' +
303 '\n'.join(problems))] 310 '\n'.join(problems))]
304 311
305 312
306 def _CheckNoDEPSGIT(input_api, output_api): 313 def _CheckNoDEPSGIT(input_api, output_api):
307 """Make sure .DEPS.git is never modified manually.""" 314 """Make sure .DEPS.git is never modified manually."""
308 if any(f.LocalPath().endswith('.DEPS.git') for f in 315 if any(f.LocalPath().endswith('.DEPS.git') for f in
309 input_api.AffectedFiles()): 316 input_api.AffectedFiles()):
310 return [output_api.PresubmitError( 317 return [output_api.PresubmitError(
311 'Never commit changes to .DEPS.git. This file is maintained by an\n' 318 'Never commit changes to .DEPS.git. This file is maintained by an\n'
312 'automated system based on what\'s in DEPS and your changes will be\n' 319 'automated system based on what\'s in DEPS and your changes will be\n'
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 572
566 trybots = ['win_rel', 'linux_rel', 'mac_rel', 'linux_clang:compile', 573 trybots = ['win_rel', 'linux_rel', 'mac_rel', 'linux_clang:compile',
567 'android'] 574 'android']
568 575
569 # Match things like path/aura/file.cc and path/file_aura.cc. 576 # Match things like path/aura/file.cc and path/file_aura.cc.
570 # Same for chromeos. 577 # Same for chromeos.
571 if any(re.search('[/_](aura|chromeos)', f) for f in files): 578 if any(re.search('[/_](aura|chromeos)', f) for f in files):
572 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile'] 579 trybots += ['linux_chromeos', 'linux_chromeos_clang:compile']
573 580
574 return trybots 581 return trybots
OLDNEW
« no previous file with comments | « no previous file | remoting/base/breakpad_win.cc » ('j') | remoting/host/host_event_logger_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698