mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
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:
parent
ff046c74c5
commit
515dff40b7
1 changed files with 0 additions and 21 deletions
21
PRESUBMIT.py
21
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue