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

Unified Diff: presubmit_canned_checks.py

Issue 119427: Add CheckChangeHasDescription. (Closed)
Patch Set: Created 11 years, 6 months 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 | 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
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 84d7f8e0c13eb8f07a82a33227b75e16ca792dde..d959a5880a2544219469517d55a5dce928472f17 100755
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -53,6 +53,16 @@ def CheckDoNotSubmitInDescription(input_api, output_api):
return []
+def CheckChangeHasDescription(input_api, output_api):
+ """Checks the CL description is not empty."""
+ text = input_api.change.DescriptionText()
+ if text.strip() == '':
+ if input_api.is_committing:
+ return [output_api.PresubmitError("Add a description.")]
+ else:
+ return [output_api.PresubmitNotifyResult("Add a description.")]
+ return []
+
### Content checks
def CheckDoNotSubmitInFiles(input_api, output_api):
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698