| Index: PRESUBMIT.py
|
| diff --git a/PRESUBMIT.py b/PRESUBMIT.py
|
| index 1f9156c4f35fc187e3f5ac4c73d75799264365bc..79de95ffa95303e779f89fe9b4100687620f6f05 100644
|
| --- a/PRESUBMIT.py
|
| +++ b/PRESUBMIT.py
|
| @@ -1341,6 +1341,7 @@ def _CommonChecks(input_api, output_api):
|
| results.extend(_CheckForIPCRules(input_api, output_api))
|
| results.extend(_CheckForOverrideAndFinalRules(input_api, output_api))
|
| results.extend(_CheckGNCheck(input_api, output_api))
|
| + results.extend(_CheckForMojoURL(input_api, output_api))
|
|
|
| if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
|
| results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
|
| @@ -1526,6 +1527,20 @@ def _CheckForIPCRules(input_api, output_api):
|
| return []
|
|
|
|
|
| +def _CheckForMojoURL(input_api, output_api):
|
| + """Check that mojo url do not use mojo://."""
|
| + errors = []
|
| + for f in input_api.AffectedFiles():
|
| + if f.LocalPath() != 'PRESUBMIT.py':
|
| + for lnum, line in f.ChangedContents():
|
| + # Disallow mojo://
|
| + if input_api.re.search(r'mojo://', line):
|
| + errors.append(output_api.PresubmitError(
|
| + ('%s:%d uses mojo:// url format. Please use mojo: instead.')
|
| + % (f.LocalPath(), lnum)))
|
| + return errors
|
| +
|
| +
|
| def CheckChangeOnUpload(input_api, output_api):
|
| results = []
|
| results.extend(_CommonChecks(input_api, output_api))
|
|
|