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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 input_api, output_api, source_file_filter=sources)) | 932 input_api, output_api, source_file_filter=sources)) |
933 snapshot( "checking tabs") | 933 snapshot( "checking tabs") |
934 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( | 934 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
935 input_api, output_api, source_file_filter=sources)) | 935 input_api, output_api, source_file_filter=sources)) |
936 snapshot( "checking stray whitespace") | 936 snapshot( "checking stray whitespace") |
937 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( | 937 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( |
938 input_api, output_api, source_file_filter=sources)) | 938 input_api, output_api, source_file_filter=sources)) |
939 snapshot("checking eol style") | 939 snapshot("checking eol style") |
940 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( | 940 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( |
941 input_api, output_api, source_file_filter=text_files)) | 941 input_api, output_api, source_file_filter=text_files)) |
942 snapshot("checking svn mime types") | |
943 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | |
944 input_api, output_api)) | |
945 snapshot("checking license") | |
946 results.extend(input_api.canned_checks.CheckLicense( | |
947 input_api, output_api, license_header, source_file_filter=sources)) | |
948 snapshot("checking nsobjects") | 942 snapshot("checking nsobjects") |
949 results.extend(_CheckConstNSObject( | 943 results.extend(_CheckConstNSObject( |
950 input_api, output_api, source_file_filter=sources)) | 944 input_api, output_api, source_file_filter=sources)) |
951 snapshot("checking singletons") | 945 snapshot("checking singletons") |
952 results.extend(_CheckSingletonInHeaders( | 946 results.extend(_CheckSingletonInHeaders( |
953 input_api, output_api, source_file_filter=sources)) | 947 input_api, output_api, source_file_filter=sources)) |
| 948 |
| 949 # The following checks are only done on commit, since the commit bot will |
| 950 # auto-fix most of these. |
| 951 if input_api.is_committing: |
| 952 snapshot("checking svn mime types") |
| 953 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
| 954 input_api, output_api)) |
| 955 snapshot("checking license") |
| 956 results.extend(input_api.canned_checks.CheckLicense( |
| 957 input_api, output_api, license_header, source_file_filter=sources)) |
954 snapshot("done") | 958 snapshot("done") |
955 return results | 959 return results |
OLD | NEW |