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

Unified Diff: PRESUBMIT.py

Issue 1237353003: Improve presubmit check for BUG line (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 5 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 | 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 34e09b8ec51b25ccc63f362fb66df403ec6dd0c4..b0b811dc41a82a74d099e7a1c5ce29f98630c28e 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -209,28 +209,32 @@ def _SkipTreeCheck(input_api, output_api):
return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip'
-def _CheckChangeLogFlag(input_api, output_api):
+def _CheckChangeLogFlag(input_api, output_api, warn):
"""Checks usage of LOG= flag in the commit message."""
results = []
- if input_api.change.BUG and not 'LOG' in input_api.change.tags:
- results.append(output_api.PresubmitError(
- 'An issue reference (BUG=) requires a change log flag (LOG=). '
- 'Use LOG=Y for including this commit message in the change log. '
- 'Use LOG=N or leave blank otherwise.'))
+ if (input_api.change.BUG and input_api.change.BUG != 'none' and
+ not 'LOG' in input_api.change.tags):
+ text = ('An issue reference (BUG=) requires a change log flag (LOG=). '
+ 'Use LOG=Y for including this commit message in the change log. '
+ 'Use LOG=N or leave blank otherwise.')
+ if warn:
+ results.append(output_api.PresubmitPromptWarning(text))
+ else:
+ results.append(output_api.PresubmitError(text))
return results
def CheckChangeOnUpload(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
- results.extend(_CheckChangeLogFlag(input_api, output_api))
+ results.extend(_CheckChangeLogFlag(input_api, output_api, True))
return results
def CheckChangeOnCommit(input_api, output_api):
results = []
results.extend(_CommonChecks(input_api, output_api))
- results.extend(_CheckChangeLogFlag(input_api, output_api))
+ results.extend(_CheckChangeLogFlag(input_api, output_api, False))
Michael Achenbach 2015/07/17 09:55:08 Can you make a test CL with e.g. BUG=foo and see i
results.extend(input_api.canned_checks.CheckChangeHasDescription(
input_api, output_api))
if not _SkipTreeCheck(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