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: dd27055cb7

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}
This commit is contained in:
mbonadei 2017-03-31 02:36:28 -07:00 committed by Commit bot
parent ff046c74c5
commit 515dff40b7

View file

@ -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