From e27eb7e62d7cdcf009c037bc17387bb73e2b1161 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Mon, 16 Nov 2015 12:47:53 +0000 Subject: [PATCH] depot_tools: make CheckLicense warn instead of notify BUG=553681 Review URL: https://codereview.chromium.org/1449853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297563 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 6 +----- tests/presubmit_unittest.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) 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 = ''