Reviewers: Michael Achenbach,
Description:
Improve presubmit check for BUG line
Don't chicken out on upload already, and ignore 'none' value
BUG=none
[email protected]
Please review this at https://codereview.chromium.org/1237353003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+12, -8 lines):
M PRESUBMIT.py
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index
34e09b8ec51b25ccc63f362fb66df403ec6dd0c4..f83be830dcb1eb99b4ef0111898ec9a8c2afc66a
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, False))
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, True))
results.extend(input_api.canned_checks.CheckChangeHasDescription(
input_api, output_api))
if not _SkipTreeCheck(input_api, output_api):
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.