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

Unified Diff: PRESUBMIT.py

Issue 93903011: Remove 'using base::string16;' from base/strings/string16.h and remove temporary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index fb1fa983e7469898a1b803e87904098e3a4662cf..04cea10dffee5aed22c9e0372b8bae7fb6e03974 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))
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698