From 515dff40b711c70780612f2a4850e151a28bacde Mon Sep 17 00:00:00 2001 From: mbonadei Date: Fri, 31 Mar 2017 02:36:28 -0700 Subject: [PATCH] Revert of Adding PRESUBMIT check on google::protobuf (patchset #2 id:20001 of https://codereview.webrtc.org/2753823003/ ) Reason for revert: We have to revert https://codereview.webrtc.org/2747863003 and this CL depends on it. Original issue's description: > Adding PRESUBMIT check on google::protobuf > > The goal is to avoid direct usage of google::protobuf. > > It should only be used with a 'using' directive in the header file: > //webrtc/base/protobuf_utils.h. > > BUG=webrtc:7340 > NOTRY=True > > Review-Url: https://codereview.webrtc.org/2753823003 > Cr-Commit-Position: refs/heads/master@{#17467} > Committed: https://chromium.googlesource.com/external/webrtc/+/dd27055cb78aa839659ed9e9f0656a265c285ae7 TBR=kjellander@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=webrtc:7340 Review-Url: https://codereview.webrtc.org/2791583002 Cr-Commit-Position: refs/heads/master@{#17481} --- PRESUBMIT.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 8fbc257232..994fcf4c75 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -487,26 +487,6 @@ def _RunPythonTests(input_api, output_api): return input_api.RunTests(tests, parallel=True) -def _CheckUsageOfGoogleProtobufNamespace(input_api, output_api): - """Checks that the namespace google::protobuf has not been used.""" - files = [] - pattern = input_api.re.compile(r'google::protobuf') - proto_utils_path = os.path.join('webrtc', 'base', 'protobuf_utils.h') - for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile): - if f.LocalPath() in [proto_utils_path, 'PRESUBMIT.py']: - continue - contents = input_api.ReadFile(f) - if pattern.search(contents): - files.append(f) - - if files: - return [output_api.PresubmitError( - 'Please avoid to use namespace `google::protobuf` directly.\n' - 'Add a using directive in `%s` and include that header instead.' - % proto_utils_path, files)] - return [] - - def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] @@ -575,7 +555,6 @@ def _CommonChecks(input_api, output_api): results.extend(_CheckUnwantedDependencies(input_api, output_api)) results.extend(_CheckJSONParseErrors(input_api, output_api)) results.extend(_RunPythonTests(input_api, output_api)) - results.extend(_CheckUsageOfGoogleProtobufNamespace(input_api, output_api)) return results