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 """Top-level presubmit script for depot tools. | 5 """Top-level presubmit script for depot tools. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for |
8 details on the presubmit API built into depot_tools. | 8 details on the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
11 import fnmatch | 11 import fnmatch |
12 import os | 12 import os |
13 | 13 |
14 | 14 |
15 def CommonChecks(input_api, output_api, tests_to_black_list): | 15 def CommonChecks(input_api, output_api, tests_to_black_list): |
16 results = [] | 16 results = [] |
17 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) | 17 results.extend(input_api.canned_checks.CheckOwners(input_api, output_api)) |
18 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ | 18 black_list = list(input_api.DEFAULT_BLACK_LIST) + [ |
19 r'^cpplint\.py$', | 19 r'^cpplint\.py$', |
20 r'^cpplint_chromium\.py$', | 20 r'^cpplint_chromium\.py$', |
21 r'^external_bin[\/\\].+', | 21 r'^external_bin[\/\\].+', |
22 r'^python[0-9]*_bin[\/\\].+', | 22 r'^python[0-9]*_bin[\/\\].+', |
23 r'^site-packages-py[0-9]\.[0-9][\/\\].+', | 23 r'^site-packages-py[0-9]\.[0-9][\/\\].+', |
24 r'^svn_bin[\/\\].+', | 24 r'^svn_bin[\/\\].+', |
25 r'^testing_support[\/\\]_rietveld[\/\\].+'] | 25 r'^testing_support[\/\\]_rietveld[\/\\].+', |
| 26 r'^bootstrap[\/\\].+'] |
26 if os.path.exists('.gitignore'): | 27 if os.path.exists('.gitignore'): |
27 with open('.gitignore') as fh: | 28 with open('.gitignore') as fh: |
28 lines = [l.strip() for l in fh.readlines()] | 29 lines = [l.strip() for l in fh.readlines()] |
29 black_list.extend([fnmatch.translate(l) for l in lines if | 30 black_list.extend([fnmatch.translate(l) for l in lines if |
30 l and not l.startswith('#')]) | 31 l and not l.startswith('#')]) |
31 if os.path.exists('.git/info/exclude'): | 32 if os.path.exists('.git/info/exclude'): |
32 with open('.git/info/exclude') as fh: | 33 with open('.git/info/exclude') as fh: |
33 lines = [l.strip() for l in fh.readlines()] | 34 lines = [l.strip() for l in fh.readlines()] |
34 black_list.extend([fnmatch.translate(l) for l in lines if | 35 black_list.extend([fnmatch.translate(l) for l in lines if |
35 l and not l.startswith('#')]) | 36 l and not l.startswith('#')]) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 | 123 |
123 def CheckChangeOnCommit(input_api, output_api): | 124 def CheckChangeOnCommit(input_api, output_api): |
124 output = [] | 125 output = [] |
125 output.extend(CommonChecks(input_api, output_api, [])) | 126 output.extend(CommonChecks(input_api, output_api, [])) |
126 output.extend(input_api.canned_checks.CheckDoNotSubmit( | 127 output.extend(input_api.canned_checks.CheckDoNotSubmit( |
127 input_api, | 128 input_api, |
128 output_api)) | 129 output_api)) |
129 output.extend(RunGitClTests(input_api, output_api)) | 130 output.extend(RunGitClTests(input_api, output_api)) |
130 return output | 131 return output |
OLD | NEW |