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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
816 reviewers_plus_owner) | 816 reviewers_plus_owner) |
817 else: | 817 else: |
818 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) | 818 missing_files = owners_db.files_not_covered_by(affected_files, reviewers) |
819 | 819 |
820 if missing_files: | 820 if missing_files: |
821 output_list = [ | 821 output_list = [ |
822 output('Missing %s for these files:\n %s' % | 822 output('Missing %s for these files:\n %s' % |
823 (needed, '\n '.join(sorted(missing_files))))] | 823 (needed, '\n '.join(sorted(missing_files))))] |
824 if not input_api.is_committing: | 824 if not input_api.is_committing: |
825 suggested_owners = owners_db.reviewers_for(missing_files, owner_email) | 825 suggested_owners = owners_db.reviewers_for(missing_files, owner_email) |
826 output_list.append(output('Suggested OWNERS:\n %s' % | 826 output_list.append(output('Suggested OWNERS: ' + |
827 ('\n '.join(suggested_owners or [])))) | 827 '(Use "owners" command to interactively select owners.)\n %s' % |
Dirk Pranke
2013/10/14 23:33:03
"git-cl owners", maybe?
scheib
2013/10/14 23:53:14
Done.
| |
828 ('\n '.join(suggested_owners or [])))) | |
828 return output_list | 829 return output_list |
829 | 830 |
830 if input_api.is_committing and not reviewers: | 831 if input_api.is_committing and not reviewers: |
831 return [output('Missing LGTM from someone other than %s' % owner_email)] | 832 return [output('Missing LGTM from someone other than %s' % owner_email)] |
832 return [] | 833 return [] |
833 | 834 |
834 | 835 |
835 def _GetRietveldIssueProps(input_api, messages): | 836 def _GetRietveldIssueProps(input_api, messages): |
836 """Gets the issue properties from rietveld.""" | 837 """Gets the issue properties from rietveld.""" |
837 issue = input_api.change.issue | 838 issue = input_api.change.issue |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1022 snapshot("checking description") | 1023 snapshot("checking description") |
1023 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1024 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
1024 input_api, output_api)) | 1025 input_api, output_api)) |
1025 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( | 1026 results.extend(input_api.canned_checks.CheckDoNotSubmitInDescription( |
1026 input_api, output_api)) | 1027 input_api, output_api)) |
1027 snapshot("checking do not submit in files") | 1028 snapshot("checking do not submit in files") |
1028 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( | 1029 results.extend(input_api.canned_checks.CheckDoNotSubmitInFiles( |
1029 input_api, output_api)) | 1030 input_api, output_api)) |
1030 snapshot("done") | 1031 snapshot("done") |
1031 return results | 1032 return results |
OLD | NEW |