Commit d22bf607 authored by Gavin Mak's avatar Gavin Mak Committed by LUCI CQ

Add number of presubmit errors/warnings in header

Headers currently have the format: `** Presubmit ${name} **`. Make these
more helpful by including the number of total errors there are.

Bug: 1341987
Change-Id: Ib41a133c31568d4264d73c14350f0bbd9590356a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3756169Reviewed-by: 's avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
parent 1601b3eb
......@@ -1792,7 +1792,7 @@ def DoPresubmitChecks(change,
for name in ['Messages', 'Warnings', 'ERRORS']:
if name in messages:
items = messages[name]
sys.stdout.write('** Presubmit %s **\n' % name)
sys.stdout.write('** Presubmit %s: %d **\n' % (name, len(items)))
for item in items:
item.handle()
sys.stdout.write('\n')
......
......@@ -882,7 +882,7 @@ def CheckChangeOnCommit(input_api, output_api):
text = (
RUNNING_PY_CHECKS_TEXT + 'Warning, no PRESUBMIT.py found.\n'
'Running default presubmit script.\n'
'** Presubmit ERRORS **\n!!\n\n'
'** Presubmit ERRORS: 1 **\n!!\n\n'
'There were Python %d presubmit errors.\n'
'Was the presubmit check useful? If not, run "git cl presubmit -v"\n'
'to figure out which PRESUBMIT.py was run, then run git blame\n'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment