| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 text_files = tuple(text_files or ( | 849 text_files = tuple(text_files or ( |
| 850 r'.+\.txt$', | 850 r'.+\.txt$', |
| 851 r'.+\.json$', | 851 r'.+\.json$', |
| 852 )) | 852 )) |
| 853 project_name = project_name or 'Chromium' | 853 project_name = project_name or 'Chromium' |
| 854 license_header = license_header or ( | 854 license_header = license_header or ( |
| 855 r'.*? Copyright \(c\) %(year)s The %(project)s Authors\. ' | 855 r'.*? Copyright \(c\) %(year)s The %(project)s Authors\. ' |
| 856 r'All rights reserved\.\n' | 856 r'All rights reserved\.\n' |
| 857 r'.*? Use of this source code is governed by a BSD-style license that ' | 857 r'.*? Use of this source code is governed by a BSD-style license that ' |
| 858 r'can be\n' | 858 r'can be\n' |
| 859 r'.*? found in the LICENSE file\.( \*/)?\n' | 859 r'.*? found in the LICENSE file\.(?: \*/)?\n' |
| 860 ) % { | 860 ) % { |
| 861 'year': input_api.time.strftime('%Y'), | 861 'year': input_api.time.strftime('%Y'), |
| 862 'project': project_name, | 862 'project': project_name, |
| 863 } | 863 } |
| 864 | 864 |
| 865 results = [] | 865 results = [] |
| 866 # This code loads the default black list (e.g. third_party, experimental, etc) | 866 # This code loads the default black list (e.g. third_party, experimental, etc) |
| 867 # and add our black list (breakpad, skia and v8 are still not following | 867 # and add our black list (breakpad, skia and v8 are still not following |
| 868 # google style and are not really living this repository). | 868 # google style and are not really living this repository). |
| 869 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. | 869 # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 914 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
| 915 input_api, output_api)) | 915 input_api, output_api)) |
| 916 snapshot("checking license") | 916 snapshot("checking license") |
| 917 results.extend(input_api.canned_checks.CheckLicense( | 917 results.extend(input_api.canned_checks.CheckLicense( |
| 918 input_api, output_api, license_header, source_file_filter=sources)) | 918 input_api, output_api, license_header, source_file_filter=sources)) |
| 919 snapshot("checking was uploaded") | 919 snapshot("checking was uploaded") |
| 920 results.extend(input_api.canned_checks.CheckChangeWasUploaded( | 920 results.extend(input_api.canned_checks.CheckChangeWasUploaded( |
| 921 input_api, output_api)) | 921 input_api, output_api)) |
| 922 snapshot("done") | 922 snapshot("done") |
| 923 return results | 923 return results |
| OLD | NEW |