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