Chromium Code Reviews

Unified Diff: presubmit_canned_checks.py

Issue 113294: Add presubmit checks to look for BUG= and TEST= tags in change list descripti... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « presubmit.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
===================================================================
--- presubmit_canned_checks.py (revision 15890)
+++ presubmit_canned_checks.py (working copy)
@@ -6,6 +6,24 @@
"""Generic presubmit checks that can be reused by other presubmit checks."""
+def CheckChangeHasTestField(input_api, output_api):
+ """Requires that the changelist have a TEST= field."""
+ if input_api.change.Test:
+ return []
+ else:
+ return [output_api.PresubmitNotifyResult(
+ "Changelist should have a TEST= field. TEST=none is allowed.")]
+
+
+def CheckChangeHasBugField(input_api, output_api):
+ """Requires that the changelist have a BUG= field."""
+ if input_api.change.BugIDs:
+ return []
+ else:
+ return [output_api.PresubmitNotifyResult(
+ "Changelist should have a BUG= field. BUG=none is allowed.")]
+
+
def CheckChangeHasTestedField(input_api, output_api):
"""Requires that the changelist have a TESTED= field."""
if input_api.change.Tested:
« no previous file with comments | « presubmit.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine