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 |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 786 | 786 |
| 787 affected_files = set([f.LocalPath() for f in | 787 affected_files = set([f.LocalPath() for f in |
| 788 input_api.change.AffectedFiles(file_filter=source_file_filter)]) | 788 input_api.change.AffectedFiles(file_filter=source_file_filter)]) |
| 789 | 789 |
| 790 owners_db = input_api.owners_db | 790 owners_db = input_api.owners_db |
| 791 owner_email, reviewers = _RietveldOwnerAndReviewers( | 791 owner_email, reviewers = _RietveldOwnerAndReviewers( |
| 792 input_api, | 792 input_api, |
| 793 owners_db.email_regexp, | 793 owners_db.email_regexp, |
| 794 approval_needed=input_api.is_committing) | 794 approval_needed=input_api.is_committing) |
| 795 | 795 |
| 796 if author_counts_as_owner: | 796 if not owner_email: |
|
M-A Ruel
2013/03/03 01:58:57
owner_email = owner_email or input_api.change.auth
Dirk Pranke
2013/03/04 21:41:12
Done.
| |
| 797 if owner_email: | 797 owner_email = input_api.change.author_email |
| 798 message = '' | 798 |
| 799 reviewers_plus_owner = reviewers.union(set([owner_email])) | 799 message = '' |
|
M-A Ruel
2013/03/03 01:58:57
this line doesn't seem useful anymore.
Dirk Pranke
2013/03/04 21:41:12
You're right. Removed the reference, below, as wel
| |
| 800 else: | 800 |
| 801 message = ('\nUntil the issue is uploaded, this list will include ' | 801 if author_counts_as_owner and owner_email: |
| 802 'files for which you are an OWNER.') | 802 reviewers_plus_owner = set([owner_email]).union(reviewers or set()) |
| 803 owner_email = '' | |
| 804 reviewers_plus_owner = set() | |
| 805 missing_files = owners_db.files_not_covered_by(affected_files, | 803 missing_files = owners_db.files_not_covered_by(affected_files, |
| 806 reviewers_plus_owner) | 804 reviewers_plus_owner) |
| 807 else: | 805 else: |
| 808 message = '' | |
| 809 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) | 806 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) |
| 810 | 807 |
| 811 if missing_files: | 808 if missing_files: |
| 812 output_list = [ | 809 output_list = [ |
| 813 output('Missing %s for these files:\n %s%s' % | 810 output('Missing %s for these files:\n %s%s' % |
| 814 (needed, '\n '.join(missing_files), message))] | 811 (needed, '\n '.join(missing_files), message))] |
| 815 if not input_api.is_committing: | 812 if not input_api.is_committing: |
| 816 suggested_owners = owners_db.reviewers_for(affected_files, owner_email) | 813 suggested_owners = owners_db.reviewers_for(affected_files, owner_email) |
| 817 output_list.append(output('Suggested OWNERS:\n %s' % | 814 output_list.append(output('Suggested OWNERS:\n %s' % |
| 818 ('\n '.join(suggested_owners or [])))) | 815 ('\n '.join(suggested_owners or [])))) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1013 snapshot("checking description") | 1010 snapshot("checking description") |
| 1014 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1011 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 1015 input_api, output_api)) | 1012 input_api, output_api)) |
| 1016 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( | 1013 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( |
| 1017 input_api, output_api)) | 1014 input_api, output_api)) |
| 1018 snapshot("checking do not submit in files") | 1015 snapshot("checking do not submit in files") |
| 1019 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( | 1016 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( |
| 1020 input_api, output_api)) | 1017 input_api, output_api)) |
| 1021 snapshot("done") | 1018 snapshot("done") |
| 1022 return results | 1019 return results |
| OLD | NEW |