depot_tools: move some checks from commit to upload

BUG=553681

Review URL: https://codereview.chromium.org/1447463002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297559 0039d316-1c4b-4281-b951-d872f2087c98
parent 02d2087b
......@@ -1103,19 +1103,17 @@ def PanProjectChecks(input_api, output_api,
snapshot("checking nsobjects")
results.extend(_CheckConstNSObject(
input_api, output_api, source_file_filter=sources))
snapshot("checking eol style")
results.extend(input_api.canned_checks.CheckChangeSvnEolStyle(
input_api, output_api, source_file_filter=text_files))
snapshot("checking license")
results.extend(input_api.canned_checks.CheckLicense(
input_api, output_api, license_header, source_file_filter=sources))
# The following checks are only done on commit, since the commit bot will
# auto-fix most of these.
if input_api.is_committing:
snapshot("checking eol style")
results.extend(input_api.canned_checks.CheckChangeSvnEolStyle(
input_api, output_api, source_file_filter=text_files))
snapshot("checking svn mime types")
results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes(
input_api, output_api))
snapshot("checking license")
results.extend(input_api.canned_checks.CheckLicense(
input_api, output_api, license_header, source_file_filter=sources))
snapshot("checking was uploaded")
results.extend(input_api.canned_checks.CheckChangeWasUploaded(
input_api, output_api))
......
......@@ -2896,6 +2896,13 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
input_api.ReadFile(affected_file).AndReturn('Hey!\nHo!\nHey!\nHo!\n\n')
input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
input_api.ReadFile(affected_file, 'rb').AndReturn(
'Hey!\nHo!\nHey!\nHo!\n\n')
affected_file.LocalPath()
self.mox.ReplayAll()
results = presubmit_canned_checks.PanProjectChecks(
input_api,
......@@ -2905,7 +2912,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
license_header=None,
project_name=None,
owners_check=False)
self.assertEqual(1, len(results))
self.assertEqual(2, len(results))
self.assertEqual(
'Found line ending with white spaces in:', results[0]._message)
self.checkstdout('')
......
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