| 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 |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 if author_counts_as_owner and owner_email: | 797 if author_counts_as_owner and owner_email: |
| 798 reviewers_plus_owner = set([owner_email]).union(reviewers) | 798 reviewers_plus_owner = set([owner_email]).union(reviewers) |
| 799 missing_files = owners_db.files_not_covered_by(affected_files, | 799 missing_files = owners_db.files_not_covered_by(affected_files, |
| 800 reviewers_plus_owner) | 800 reviewers_plus_owner) |
| 801 else: | 801 else: |
| 802 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) | 802 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) |
| 803 | 803 |
| 804 if missing_files: | 804 if missing_files: |
| 805 output_list = [ | 805 output_list = [ |
| 806 output('Missing %s for these files:\n %s' % | 806 output('Missing %s for these files:\n %s' % |
| 807 (needed, '\n '.join(missing_files)))] | 807 (needed, '\n '.join(sorted(missing_files))))] |
| 808 if not input_api.is_committing: | 808 if not input_api.is_committing: |
| 809 suggested_owners = owners_db.reviewers_for(affected_files, owner_email) | 809 suggested_owners = owners_db.reviewers_for(affected_files, owner_email) |
| 810 output_list.append(output('Suggested OWNERS:\n %s' % | 810 output_list.append(output('Suggested OWNERS:\n %s' % |
| 811 ('\n '.join(suggested_owners or [])))) | 811 ('\n '.join(suggested_owners or [])))) |
| 812 return output_list | 812 return output_list |
| 813 | 813 |
| 814 if input_api.is_committing and not reviewers: | 814 if input_api.is_committing and not reviewers: |
| 815 return [output('Missing LGTM from someone other than %s' % owner_email)] | 815 return [output('Missing LGTM from someone other than %s' % owner_email)] |
| 816 return [] | 816 return [] |
| 817 | 817 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 snapshot("checking description") | 1006 snapshot("checking description") |
| 1007 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1007 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 1008 input_api, output_api)) | 1008 input_api, output_api)) |
| 1009 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( | 1009 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( |
| 1010 input_api, output_api)) | 1010 input_api, output_api)) |
| 1011 snapshot("checking do not submit in files") | 1011 snapshot("checking do not submit in files") |
| 1012 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( | 1012 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( |
| 1013 input_api, output_api)) | 1013 input_api, output_api)) |
| 1014 snapshot("done") | 1014 snapshot("done") |
| 1015 return results | 1015 return results |
| OLD | NEW |