Index: PRESUBMIT.py |
diff --git a/PRESUBMIT.py b/PRESUBMIT.py |
index 4195f5ab79781febb69d040698cb80a20499d960..33525749f7ca15436815de578dd0b311c14fab6c 100644 |
--- a/PRESUBMIT.py |
+++ b/PRESUBMIT.py |
@@ -292,14 +292,21 @@ def _CheckNoNewWStrings(input_api, output_api): |
f.LocalPath().endswith('test.cc')): |
continue |
+ allowWString = False |
for line_num, line in f.ChangedContents(): |
- if 'wstring' in line: |
+ if 'presubmit: allow wstring' in line: |
+ allowWString = True |
+ elif not allowWString and 'wstring' in line: |
problems.append(' %s:%d' % (f.LocalPath(), line_num)) |
+ allowWString = False |
+ else: |
+ allowWString = False |
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' + |
+ ' If you are calling a cross-platform API that accepts a wstring, ' |
+ 'fix the API.\n' + |
'\n'.join(problems))] |