From 18fc4e55077476d34babd23baf61881df71a9e8c Mon Sep 17 00:00:00 2001 From: Scott Lee Date: Mon, 18 Aug 2025 15:07:50 -0700 Subject: [PATCH] presubmit: add bypass-check-license instruction in the failure message https://crrev.com/c/6842238 added the bypass instructions to the presubmit failure messages, but it missed one place. Bug: 435696543 Change-Id: Ic48b4cd3ba0f9797b48ff7e54f7a25b8c83a686b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6858267 Auto-Submit: Scott Lee Commit-Queue: Scott Lee Reviewed-by: Brian Egizi --- presubmit_canned_checks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index a8f7b98148..59182f889e 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -852,8 +852,12 @@ def CheckLicense(input_api, if bad_new_files: if license_re_param: - error_message = ('License on new files must match:\n\n%s\n' % - license_re_param) + error_message = ( + 'License on new files must match:\n\n{lp}\n\n' + 'To bypass this check, add {k}: in the description.\n' + 'If this check fails for non-exceptional cases, consider ' + 'tuning the PRESUBMIT.py instead.').format( + lp=license_re_param, k=_BYPASS_CHECK_LICENSE_FOOTER) else: # Verbatim text that can be copy-pasted into new files (possibly # adjusting the leading comment delimiter).