Add next steps to 'git cl presubmit' cog error message

This updates the presubmit error message when running on Cog to
include instructions on how to trigger presubmits. This also
standardizes the messaging across git cl presubmit/web/presubmit.

Bug: 394615879
Change-Id: Iaa8857268cd43219f7502eb34388034890a919dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6240212
Reviewed-by: Andy Perelson <ajp@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/12/6240212/6
Gavin Mak 5 months ago committed by LUCI CQ
parent 7cffe56af4
commit 912a744103

@ -5024,9 +5024,10 @@ def CMDlint(parser, args):
def CMDpresubmit(parser, args):
"""Runs presubmit tests on the current changelist."""
if gclient_utils.IsEnvCog():
# TODO - crbug/336555565: give user more instructions on how to
# trigger presubmit in Cog once the UX is finalized.
print('presubmit command is not supported in non-git environment.',
print('presubmit command is not supported in non-git environment. '
'Please use the "Chromium PRESUBMITS" panel or the "Run '
'Presubmit Checks" command in the command palette in the editor '
'instead.',
file=sys.stderr)
return 1
parser.add_option('-u',
@ -6308,9 +6309,9 @@ def CMDweb(parser, args):
"""Opens the current CL in the web browser."""
if gclient_utils.IsEnvCog():
print(
'web command is not supported. Please use "Gerrit: Open Changes '
'in Gerrit" functionality in the command palette in the Editor '
'instead.',
'web command is not supported in non-git environment. Please use '
'"Gerrit: Open Changes in Gerrit" functionality in the command '
'palette in the editor instead.',
file=sys.stderr)
return 1
@ -6958,9 +6959,9 @@ def CMDformat(parser, args):
"""Runs auto-formatting tools (clang-format etc.) on the diff."""
if gclient_utils.IsEnvCog():
print(
'format command is not supported. Please use the "Format '
'Modified Lines in All Files (git cl format)" functionality in'
'command palette in the editor instead.',
'format command is not supported in non-git environment. Please '
'use the "Format Modified Lines in All Files (git cl format)" '
'functionality in the command palette in the editor instead.',
file=sys.stderr)
return 1
clang_exts = ['.cc', '.cpp', '.h', '.m', '.mm', '.proto']

Loading…
Cancel
Save