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 Chromium. | 5 """Top-level presubmit script for Chromium. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 # ], | 1440 # ], |
1441 # }, | 1441 # }, |
1442 # } | 1442 # } |
1443 to_check = {} | 1443 to_check = {} |
1444 | 1444 |
1445 # Iterate through the affected files to see what we actually need to check | 1445 # Iterate through the affected files to see what we actually need to check |
1446 # for. We should only nag patch authors about per-file rules if a file in that | 1446 # for. We should only nag patch authors about per-file rules if a file in that |
1447 # directory would match that pattern. If a directory only contains *.mojom | 1447 # directory would match that pattern. If a directory only contains *.mojom |
1448 # files and no *_messages*.h files, we should only nag about rules for | 1448 # files and no *_messages*.h files, we should only nag about rules for |
1449 # *.mojom files. | 1449 # *.mojom files. |
1450 for f in input_api.change.AffectedFiles(): | 1450 for f in input_api.change.AffectedFiles(include_deletes=False): |
1451 for pattern in file_patterns: | 1451 for pattern in file_patterns: |
1452 if input_api.fnmatch.fnmatch( | 1452 if input_api.fnmatch.fnmatch( |
1453 input_api.os_path.basename(f.LocalPath()), pattern): | 1453 input_api.os_path.basename(f.LocalPath()), pattern): |
1454 owners_file = input_api.os_path.join( | 1454 owners_file = input_api.os_path.join( |
1455 input_api.os_path.dirname(f.LocalPath()), 'OWNERS') | 1455 input_api.os_path.dirname(f.LocalPath()), 'OWNERS') |
1456 if owners_file not in to_check: | 1456 if owners_file not in to_check: |
1457 to_check[owners_file] = {} | 1457 to_check[owners_file] = {} |
1458 if pattern not in to_check[owners_file]: | 1458 if pattern not in to_check[owners_file]: |
1459 to_check[owners_file][pattern] = { | 1459 to_check[owners_file][pattern] = { |
1460 'files': [], | 1460 'files': [], |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 2223 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
2224 input_api, | 2224 input_api, |
2225 output_api, | 2225 output_api, |
2226 json_url='http://chromium-status.appspot.com/current?format=json')) | 2226 json_url='http://chromium-status.appspot.com/current?format=json')) |
2227 | 2227 |
2228 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2228 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
2229 input_api, output_api)) | 2229 input_api, output_api)) |
2230 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2230 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
2231 input_api, output_api)) | 2231 input_api, output_api)) |
2232 return results | 2232 return results |
OLD | NEW |