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, ...@@ -1103,19 +1103,17 @@ def PanProjectChecks(input_api, output_api,
snapshot("checking nsobjects") snapshot("checking nsobjects")
results.extend(_CheckConstNSObject( results.extend(_CheckConstNSObject(
input_api, output_api, source_file_filter=sources)) 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: 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") snapshot("checking svn mime types")
results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes(
input_api, output_api)) 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") snapshot("checking was uploaded")
results.extend(input_api.canned_checks.CheckChangeWasUploaded( results.extend(input_api.canned_checks.CheckChangeWasUploaded(
input_api, output_api)) input_api, output_api))
......
...@@ -2896,6 +2896,13 @@ class CannedChecksUnittest(PresubmitTestsBase): ...@@ -2896,6 +2896,13 @@ class CannedChecksUnittest(PresubmitTestsBase):
input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file]) input_api.AffectedSourceFiles(mox.IgnoreArg()).AndReturn([affected_file])
input_api.ReadFile(affected_file).AndReturn('Hey!\nHo!\nHey!\nHo!\n\n') 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() self.mox.ReplayAll()
results = presubmit_canned_checks.PanProjectChecks( results = presubmit_canned_checks.PanProjectChecks(
input_api, input_api,
...@@ -2905,7 +2912,7 @@ class CannedChecksUnittest(PresubmitTestsBase): ...@@ -2905,7 +2912,7 @@ class CannedChecksUnittest(PresubmitTestsBase):
license_header=None, license_header=None,
project_name=None, project_name=None,
owners_check=False) owners_check=False)
self.assertEqual(1, len(results)) self.assertEqual(2, len(results))
self.assertEqual( self.assertEqual(
'Found line ending with white spaces in:', results[0]._message) 'Found line ending with white spaces in:', results[0]._message)
self.checkstdout('') 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