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

Loading…
Cancel
Save