OLD | NEW |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Generic presubmit checks that can be reused by other presubmit checks.""" | 5 """Generic presubmit checks that can be reused by other presubmit checks.""" |
6 | 6 |
7 | 7 |
8 ### Description checks | 8 ### Description checks |
9 | 9 |
10 def CheckChangeHasTestField(input_api, output_api): | 10 def CheckChangeHasTestField(input_api, output_api): |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 dt2 = input_api.time.clock() | 880 dt2 = input_api.time.clock() |
881 if snapshot_memory: | 881 if snapshot_memory: |
882 delta_ms = int(1000*(dt2 - snapshot_memory[0])) | 882 delta_ms = int(1000*(dt2 - snapshot_memory[0])) |
883 if delta_ms > 500: | 883 if delta_ms > 500: |
884 print " %s took a long time: %dms" % (snapshot_memory[1], delta_ms) | 884 print " %s took a long time: %dms" % (snapshot_memory[1], delta_ms) |
885 snapshot_memory[:] = (dt2, msg) | 885 snapshot_memory[:] = (dt2, msg) |
886 | 886 |
887 if owners_check: | 887 if owners_check: |
888 snapshot("checking owners") | 888 snapshot("checking owners") |
889 results.extend(input_api.canned_checks.CheckOwners( | 889 results.extend(input_api.canned_checks.CheckOwners( |
890 input_api, output_api, source_file_filter=sources)) | 890 input_api, output_api, source_file_filter=None)) |
891 | 891 |
892 snapshot("checking long lines") | 892 snapshot("checking long lines") |
893 results.extend(input_api.canned_checks.CheckLongLines( | 893 results.extend(input_api.canned_checks.CheckLongLines( |
894 input_api, output_api, source_file_filter=sources)) | 894 input_api, output_api, source_file_filter=sources)) |
895 snapshot( "checking tabs") | 895 snapshot( "checking tabs") |
896 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( | 896 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
897 input_api, output_api, source_file_filter=sources)) | 897 input_api, output_api, source_file_filter=sources)) |
898 snapshot( "checking stray whitespace") | 898 snapshot( "checking stray whitespace") |
899 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( | 899 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( |
900 input_api, output_api, source_file_filter=sources)) | 900 input_api, output_api, source_file_filter=sources)) |
(...skipping 11 matching lines...) Expand all Loading... |
912 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( | 912 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( |
913 input_api, output_api, source_file_filter=text_files)) | 913 input_api, output_api, source_file_filter=text_files)) |
914 snapshot("checking svn mime types") | 914 snapshot("checking svn mime types") |
915 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 915 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
916 input_api, output_api)) | 916 input_api, output_api)) |
917 snapshot("checking license") | 917 snapshot("checking license") |
918 results.extend(input_api.canned_checks.CheckLicense( | 918 results.extend(input_api.canned_checks.CheckLicense( |
919 input_api, output_api, license_header, source_file_filter=sources)) | 919 input_api, output_api, license_header, source_file_filter=sources)) |
920 snapshot("done") | 920 snapshot("done") |
921 return results | 921 return results |
OLD | NEW |