Chromium Code Reviews| Index: PRESUBMIT.py |
| diff --git a/PRESUBMIT.py b/PRESUBMIT.py |
| index 3b8669ad4b8f6d87f21720d66477f613c14f0b0a..dec08f7b1171e78863d7b6ac0a57d004bd5e2a59 100644 |
| --- a/PRESUBMIT.py |
| +++ b/PRESUBMIT.py |
| @@ -689,6 +689,7 @@ def _CommonChecks(input_api, output_api): |
| results.extend(_CheckNoAuraWindowPropertyHInHeaders(input_api, output_api)) |
| results.extend(_CheckIncludeOrder(input_api, output_api)) |
| results.extend(_CheckForVersionControlConflicts(input_api, output_api)) |
| + results.extend(_CheckPatchFiles(input_api, output_api)) |
| if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): |
| results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
| @@ -772,6 +773,17 @@ def _CheckAuthorizedAuthor(input_api, output_api): |
| return [] |
| +def _CheckPatchFiles(input_api, output_api): |
| + if_patch_file = input_api.re.compile(r'.*\.(rej|orig)$') |
| + problems = [f.LocalPath() for f in input_api.AffectedFiles() if |
| + if_patch_file.match(f.LocalPath())] |
|
M-A Ruel
2012/12/05 19:30:17
if f.LocalPath().endswith(('.orig', '.rej'))
is cl
|
| + if problems: |
| + return [output_api.PresubmitError( |
| + "Don't commit .rej and .orig files.", problems)] |
| + else: |
| + return [] |
| + |
| + |
| def CheckChangeOnUpload(input_api, output_api): |
| results = [] |
| results.extend(_CommonChecks(input_api, output_api)) |