Skip to content

Commit

Permalink
Downgrade the wstring check from an error to a warning.
Browse files Browse the repository at this point in the history
BUG=None
TEST=manual


Review URL: http://codereview.chromium.org/8229016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104970 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tony@chromium.org committed Oct 12, 2011
1 parent d070582 commit 55463aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,21 @@ def _CheckNoIOStreamInHeaders(input_api, output_api):

def _CheckNoNewWStrings(input_api, output_api):
"""Checks to make sure we don't introduce use of wstrings."""
errors = []
problems = []
for f in input_api.AffectedFiles():
for line_num, line in f.ChangedContents():
if (not f.LocalPath().endswith(('.cc', '.h')) or
f.LocalPath().endswith('test.cc')):
continue

if 'wstring' in line:
errors.append(output_api.PresubmitError(
'%s, line %d: new code should not use wstrings. If you are '
'calling an API that accepts a wstring, fix the API.'
% (f.LocalPath(), line_num)))
problems.append(' %s:%d' % (f.LocalPath(), line_num))

return errors
if not problems:
return []
return [output_api.PresubmitPromptWarning('New code should not use wstrings.'
' If you are calling an API that accepts a wstring, fix the API.\n' +
'\n'.join(problems))]


def _CommonChecks(input_api, output_api):
Expand Down

0 comments on commit 55463aa

Please sign in to comment.