Chromium Code Reviews| 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 import os as _os | 7 import os as _os |
| 8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) | 8 _HERE = _os.path.dirname(_os.path.abspath(__file__)) |
| 9 | 9 |
| 10 | 10 |
| 11 ### Description checks | 11 ### Description checks |
| 12 | 12 |
| 13 def CheckChangeHasTestField(input_api, output_api): | |
|
M-A Ruel
2012/07/27 00:05:26
Do not remove it. This would break current users.
| |
| 14 """Requires that the changelist have a TEST= field.""" | |
| 15 if input_api.change.TEST: | |
| 16 return [] | |
| 17 else: | |
| 18 return [output_api.PresubmitNotifyResult( | |
| 19 'If this change requires manual test instructions to QA team, add ' | |
| 20 'TEST=[instructions].')] | |
| 21 | |
| 22 | |
| 23 def CheckChangeHasBugField(input_api, output_api): | 13 def CheckChangeHasBugField(input_api, output_api): |
| 24 """Requires that the changelist have a BUG= field.""" | 14 """Requires that the changelist have a BUG= field.""" |
| 25 if input_api.change.BUG: | 15 if input_api.change.BUG: |
| 26 return [] | 16 return [] |
| 27 else: | 17 else: |
| 28 return [output_api.PresubmitNotifyResult( | 18 return [output_api.PresubmitNotifyResult( |
| 29 'If this change has an associated bug, add BUG=[bug number].')] | 19 'If this change has an associated bug, add BUG=[bug number].')] |
| 30 | 20 |
| 31 | 21 |
| 32 def CheckChangeHasTestedField(input_api, output_api): | 22 def CheckChangeHasTestedField(input_api, output_api): |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( | 935 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( |
| 946 input_api, output_api)) | 936 input_api, output_api)) |
| 947 snapshot("checking license") | 937 snapshot("checking license") |
| 948 results.extend(input_api.canned_checks.CheckLicense( | 938 results.extend(input_api.canned_checks.CheckLicense( |
| 949 input_api, output_api, license_header, source_file_filter=sources)) | 939 input_api, output_api, license_header, source_file_filter=sources)) |
| 950 snapshot("checking was uploaded") | 940 snapshot("checking was uploaded") |
| 951 results.extend(input_api.canned_checks.CheckChangeWasUploaded( | 941 results.extend(input_api.canned_checks.CheckChangeWasUploaded( |
| 952 input_api, output_api)) | 942 input_api, output_api)) |
| 953 snapshot("done") | 943 snapshot("done") |
| 954 return results | 944 return results |
| OLD | NEW |