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))
results.extend(input_api.canned_checks.CheckChangeHasDescription(
input_api, output_api))
if not _SkipTreeCheck(input_api, output_api):