diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 5247f1dc98..3abdbb4992 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -419,11 +419,7 @@ def CheckLicense(input_api, output_api, license_re, source_file_filter=None, if not license_re.search(contents): bad_files.append(f.LocalPath()) if bad_files: - if input_api.is_committing: - res_type = output_api.PresubmitPromptWarning - else: - res_type = output_api.PresubmitNotifyResult - return [res_type( + return [output_api.PresubmitPromptWarning( 'License must match:\n%s\n' % license_re.pattern + 'Found a bad license header in these files:', items=bad_files)] return [] diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 2a90ab3c34..6456e0e6c5 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -2324,7 +2324,7 @@ class CannedChecksUnittest(PresubmitTestsBase): r".*? All Rights Reserved\." "\n" ) self._LicenseCheck(text, license_text, False, - presubmit.OutputApi.PresubmitNotifyResult) + presubmit.OutputApi.PresubmitPromptWarning) def testCheckLicenseEmptySuccess(self): text = ''