Add presubmit check to prevent further changes to webrtc/base.
R=mbonadei@webrtc.org TBR=kjellander@webrtc.org NOTRY=True BUG=webrtc:7634 Review-Url: https://codereview.webrtc.org/2972363002 Cr-Commit-Position: refs/heads/master@{#18951}
This commit is contained in:
19
PRESUBMIT.py
19
PRESUBMIT.py
@ -510,6 +510,24 @@ def _CheckUsageOfGoogleProtobufNamespace(input_api, output_api):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def _CheckNoChangesToWebRTCBase(input_api, output_api):
|
||||||
|
"""Checks that no changes refer to webrtc/base."""
|
||||||
|
problems = []
|
||||||
|
|
||||||
|
for f in input_api.AffectedFiles():
|
||||||
|
if os.path.join('webrtc', 'base') in f.LocalPath():
|
||||||
|
problems.append(' ' + f.LocalPath())
|
||||||
|
continue
|
||||||
|
for line_num, line in f.ChangedContents():
|
||||||
|
if 'webrtc/base' in line:
|
||||||
|
problems.append(' %s: %s' % (f.LocalPath(), line_num))
|
||||||
|
|
||||||
|
return [output_api.PresubmitPromptWarning(
|
||||||
|
'webrtc/base is being moved to webrtc/rtc_base (See '
|
||||||
|
'bugs.webrtc.org/7634). Please refer to webrtc/rtc_base instead in the '
|
||||||
|
'following files:\n' + '\n'.join(problems))]
|
||||||
|
|
||||||
|
|
||||||
def _CommonChecks(input_api, output_api):
|
def _CommonChecks(input_api, output_api):
|
||||||
"""Checks common to both upload and commit."""
|
"""Checks common to both upload and commit."""
|
||||||
results = []
|
results = []
|
||||||
@ -578,6 +596,7 @@ def _CommonChecks(input_api, output_api):
|
|||||||
results.extend(_CheckUsageOfGoogleProtobufNamespace(input_api, output_api))
|
results.extend(_CheckUsageOfGoogleProtobufNamespace(input_api, output_api))
|
||||||
results.extend(_CheckOrphanHeaders(input_api, output_api))
|
results.extend(_CheckOrphanHeaders(input_api, output_api))
|
||||||
results.extend(_CheckNewLineAtTheEndOfProtoFiles(input_api, output_api))
|
results.extend(_CheckNewLineAtTheEndOfProtoFiles(input_api, output_api))
|
||||||
|
results.extend(_CheckNoChangesToWebRTCBase(input_api, output_api))
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user