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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 return [ output_api.PresubmitError( | 831 return [ output_api.PresubmitError( |
832 'Found Singleton<T> in the following header files.\n' + | 832 'Found Singleton<T> in the following header files.\n' + |
833 'Please move them to an appropriate source file so that the ' + | 833 'Please move them to an appropriate source file so that the ' + |
834 'template gets instantiated in a single compilation unit.', | 834 'template gets instantiated in a single compilation unit.', |
835 files) ] | 835 files) ] |
836 return [] | 836 return [] |
837 | 837 |
838 | 838 |
839 def PanProjectChecks(input_api, output_api, | 839 def PanProjectChecks(input_api, output_api, |
840 excluded_paths=None, text_files=None, | 840 excluded_paths=None, text_files=None, |
841 license_header=None, project_name=None): | 841 license_header=None, project_name=None, |
| 842 owners_check=True): |
842 """Checks that ALL chromium orbit projects should use. | 843 """Checks that ALL chromium orbit projects should use. |
843 | 844 |
844 These are checks to be run on all Chromium orbit project, including: | 845 These are checks to be run on all Chromium orbit project, including: |
845 Chromium | 846 Chromium |
846 Native Client | 847 Native Client |
847 V8 | 848 V8 |
848 When you update this function, please take this broad scope into account. | 849 When you update this function, please take this broad scope into account. |
849 Args: | 850 Args: |
850 input_api: Bag of input related interfaces. | 851 input_api: Bag of input related interfaces. |
851 output_api: Bag of output related interfaces. | 852 output_api: Bag of output related interfaces. |
(...skipping 25 matching lines...) Expand all Loading... |
877 # This code loads the default black list (e.g. third_party, experimental, etc) | 878 # This code loads the default black list (e.g. third_party, experimental, etc) |
878 # and add our black list (breakpad, skia and v8 are still not following | 879 # and add our black list (breakpad, skia and v8 are still not following |
879 # google style and are not really living this repository). | 880 # google style and are not really living this repository). |
880 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. | 881 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. |
881 black_list = input_api.DEFAULT_BLACK_LIST + excluded_paths | 882 black_list = input_api.DEFAULT_BLACK_LIST + excluded_paths |
882 white_list = input_api.DEFAULT_WHITE_LIST + text_files | 883 white_list = input_api.DEFAULT_WHITE_LIST + text_files |
883 sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) | 884 sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) |
884 text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, | 885 text_files = lambda x: input_api.FilterSourceFile(x, black_list=black_list, |
885 white_list=white_list) | 886 white_list=white_list) |
886 | 887 |
887 results.extend(input_api.canned_checks.CheckOwners( | 888 if owners_check: |
888 input_api, output_api, source_file_filter=sources)) | 889 results.extend(input_api.canned_checks.CheckOwners( |
| 890 input_api, output_api, source_file_filter=sources)) |
889 | 891 |
890 results.extend(input_api.canned_checks.CheckLongLines( | 892 results.extend(input_api.canned_checks.CheckLongLines( |
891 input_api, output_api, source_file_filter=sources)) | 893 input_api, output_api, source_file_filter=sources)) |
892 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( | 894 results.extend(input_api.canned_checks.CheckChangeHasNoTabs( |
893 input_api, output_api, source_file_filter=sources)) | 895 input_api, output_api, source_file_filter=sources)) |
894 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( | 896 results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( |
895 input_api, output_api, source_file_filter=sources)) | 897 input_api, output_api, source_file_filter=sources)) |
896 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( | 898 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( |
897 input_api, output_api, source_file_filter=text_files)) | 899 input_api, output_api, source_file_filter=text_files)) |
898 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 900 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
899 input_api, output_api)) | 901 input_api, output_api)) |
900 results.extend(input_api.canned_checks.CheckLicense( | 902 results.extend(input_api.canned_checks.CheckLicense( |
901 input_api, output_api, license_header, source_file_filter=sources)) | 903 input_api, output_api, license_header, source_file_filter=sources)) |
902 results.extend(_CheckConstNSObject( | 904 results.extend(_CheckConstNSObject( |
903 input_api, output_api, source_file_filter=sources)) | 905 input_api, output_api, source_file_filter=sources)) |
904 results.extend(_CheckSingletonInHeaders( | 906 results.extend(_CheckSingletonInHeaders( |
905 input_api, output_api, source_file_filter=sources)) | 907 input_api, output_api, source_file_filter=sources)) |
906 return results | 908 return results |
OLD | NEW |