diff options
author | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-30 21:43:00 +0000 |
---|---|---|
committer | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-30 21:43:00 +0000 |
commit | f527d9cdabd11282598dc769fa32ed9490c877d9 (patch) | |
tree | 3387e648f4cf2b95402a68fef36f60d1738752ff /PRESUBMIT.py | |
parent | 42303816401b4b75fb221c6e59d423fd2ec32f5d (diff) | |
download | chromium_src-f527d9cdabd11282598dc769fa32ed9490c877d9.zip chromium_src-f527d9cdabd11282598dc769fa32ed9490c877d9.tar.gz chromium_src-f527d9cdabd11282598dc769fa32ed9490c877d9.tar.bz2 |
Remove 'using base::string16;' from base/strings/string16.h and remove temporary
PRESUBMIT.py _CheckForString16().
R=brettw@chromium.org, maruel@chromium.org
TBR=sky@chromium.org, tsepez@chromium.org
BUG=329295
Review URL: https://codereview.chromium.org/93903011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index fb1fa98..04cea10 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1037,7 +1037,6 @@ def _CommonChecks(input_api, output_api): results.extend(_CheckForAnonymousVariables(input_api, output_api)) results.extend(_CheckCygwinShell(input_api, output_api)) results.extend(_CheckJavaStyle(input_api, output_api)) - results.extend(_CheckForString16(input_api, output_api)) if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): results.extend(input_api.canned_checks.RunUnitTestsInDirectory( @@ -1180,55 +1179,6 @@ def _CheckForInvalidOSMacros(input_api, output_api): 'or add your macro to src/PRESUBMIT.py.', bad_macros)] -def _CheckForString16InFile(input_api, f): - """Check for string16 without base:: in front.""" - reg = input_api.re.compile(r'\b(?<!base::)string16\b') - use = 'using base::string16;' - include = '#include "base/strings/string16.h"' - results = [] - for lnum, line in f.ChangedContents(): - if reg.search(line) and not include in line and not use in f.NewContents(): - results.append(' %s:%d' % (f.LocalPath(), lnum)) - return results - - -def _CheckForString16(input_api, output_api): - file_filter = lambda f: input_api.FilterSourceFile(f, - white_list=( - r'^android_webview[\\\/]', - r'^apps[\\\/]', - r'^ash[\\\/]', - r'^chrome[\\\/]', - r'^chrome_frame[\\\/]', - r'^chromeos[\\\/]', - r'^components[\\\/]', - r'^content[\\\/]', - r'^device[\\\/]', - r'^ipc[\\\/]', - r'^net[\\\/]', - r'^ppapi[\\\/]', - r'^printing[\\\/]', - r'^rlz[\\\/]', - r'^skia[\\\/]', - r'^tools[\\\/]', - r'^ui[\\\/]', - r'^webkit[\\\/]', - r'^win8[\\\/]', - ), - black_list=(_EXCLUDED_PATHS + _TEST_CODE_EXCLUDED_PATHS + - input_api.DEFAULT_BLACK_LIST)) - - unprefixed = [] - for f in input_api.AffectedFiles(file_filter=file_filter): - unprefixed.extend(_CheckForString16InFile(input_api, f)) - - if not unprefixed: - return [] - - return [output_api.PresubmitPromptWarning( - 'string16 should be prefixed with base:: namespace.', unprefixed)] - - def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) |