Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 | |
| 6 _DELETIONS_ONLY_FILES = ( | |
| 7 'build/android/findbugs_filter/findbugs_known_bugs.txt', | |
|
M-A Ruel
2013/01/15 02:16:23
I thought the path was corrected to you should use
| |
| 8 ) | |
| 9 | |
| 10 | |
| 11 def _CheckDeletionsOnlyFiles(input_api, output_api): | |
| 12 """Check that a certain listed files only have deletions. | |
| 13 """ | |
| 14 errors = [] | |
| 15 for f in input_api.AffectedFiles(): | |
| 16 if f.LocalPath() in _DELETIONS_ONLY_FILES: | |
| 17 if f.ChangedContents(): | |
| 18 errors.append(f.LocalPath()) | |
| 19 results = [] | |
| 20 if errors: | |
| 21 results.append(output_api.PresubmitError( | |
| 22 'Following files should only contain deletions.', errors)) | |
| 23 return results | |
| 24 | |
| 25 | |
| 26 def CommonChecks(input_api, output_api): | |
| 27 output = [] | |
| 28 output.extend(input_api.canned_checks.RunPylint( | |
| 29 input_api, | |
| 30 output_api, | |
| 31 white_list=[r'PRESUBMIT\.py$'], | |
| 32 extra_paths_list=[])) | |
| 33 | |
| 34 output.extend(_CheckDeletionsOnlyFiles(input_api, output_api)) | |
| 35 return output | |
| 36 | |
| 37 | |
| 38 def CheckChangeOnUpload(input_api, output_api): | |
| 39 return CommonChecks(input_api, output_api) | |
| 40 | |
| 41 | |
| 42 def CheckChangeOnCommit(input_api, output_api): | |
| 43 return CommonChecks(input_api, output_api) | |
| OLD | NEW |