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
parent d965db30
...@@ -419,11 +419,7 @@ def CheckLicense(input_api, output_api, license_re, source_file_filter=None, ...@@ -419,11 +419,7 @@ def CheckLicense(input_api, output_api, license_re, source_file_filter=None,
if not license_re.search(contents): if not license_re.search(contents):
bad_files.append(f.LocalPath()) bad_files.append(f.LocalPath())
if bad_files: if bad_files:
if input_api.is_committing: return [output_api.PresubmitPromptWarning(
res_type = output_api.PresubmitPromptWarning
else:
res_type = output_api.PresubmitNotifyResult
return [res_type(
'License must match:\n%s\n' % license_re.pattern + 'License must match:\n%s\n' % license_re.pattern +
'Found a bad license header in these files:', items=bad_files)] 'Found a bad license header in these files:', items=bad_files)]
return [] return []
......
...@@ -2324,7 +2324,7 @@ class CannedChecksUnittest(PresubmitTestsBase): ...@@ -2324,7 +2324,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
r".*? All Rights Reserved\." "\n" r".*? All Rights Reserved\." "\n"
) )
self._LicenseCheck(text, license_text, False, self._LicenseCheck(text, license_text, False,
presubmit.OutputApi.PresubmitNotifyResult) presubmit.OutputApi.PresubmitPromptWarning)
def testCheckLicenseEmptySuccess(self): def testCheckLicenseEmptySuccess(self):
text = '' text = ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment