Chromium Code Reviews| Index: presubmit_canned_checks.py |
| diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py |
| index 79e030918bef92254281b482f52ec1a7f892236b..ee6f45333093261ab7f4a1ae3c2d346861bbf4c7 100644 |
| --- a/presubmit_canned_checks.py |
| +++ b/presubmit_canned_checks.py |
| @@ -624,3 +624,29 @@ def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings, |
| 'builds are pending.' % max_pendings, |
| long_text='\n'.join(out))] |
| return [] |
| + |
| + |
| +def CheckOwners(input_api, output_api): |
| + affected_files = set(input_api.change.AffectedFiles()) |
| + owners_db = input_api.owners_db |
| + |
| + if input_api.is_commiting: |
| + approving_reviewers = _GetApproversFor(input_api) |
| + missing_files = owners_db.FilesNotCoveredBy(affected_files, |
| + approving_reviewers): |
| + if missing_files: |
| + return [output_api.PresubmitPromptWarning('Missing approvals for: %s' % |
| + ','.join(missing_files)] |
| + return [] |
| + else: |
| + suggested_reviewers = owners_db.OwnersFor(affected_files)[0] |
| + _AddReviewers(suggested_reviewers) |
| + |
| +def _GetApproversFor(input_api) |
| + # TODO: implement - copy from the lgtm verifier, add support for |
| + # "defer to". |
| + return ['maruel'] |
|
M-A Ruel
2011/02/24 16:25:57
I know it's an example but it should use fully qua
|
| + |
| +def _AddReviewers(input_api): |
|
M-A Ruel
2011/02/24 16:25:57
This will need to be in presubmit_support.Change.
|
| + # TODO: implement? |
| + pass |