Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: PRESUBMIT.py

Issue 681203005: Do not allow mojo:// URLs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698