| 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 gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 660 |
| 661 def _CheckHardcodedGoogleHostsInLowerLayers(input_api, output_api): | 661 def _CheckHardcodedGoogleHostsInLowerLayers(input_api, output_api): |
| 662 def FilterFile(affected_file): | 662 def FilterFile(affected_file): |
| 663 """Filter function for use with input_api.AffectedSourceFiles, | 663 """Filter function for use with input_api.AffectedSourceFiles, |
| 664 below. This filters out everything except non-test files from | 664 below. This filters out everything except non-test files from |
| 665 top-level directories that generally speaking should not hard-code | 665 top-level directories that generally speaking should not hard-code |
| 666 service URLs (e.g. src/android_webview/, src/content/ and others). | 666 service URLs (e.g. src/android_webview/, src/content/ and others). |
| 667 """ | 667 """ |
| 668 return input_api.FilterSourceFile( | 668 return input_api.FilterSourceFile( |
| 669 affected_file, | 669 affected_file, |
| 670 white_list=('^(android_webview|base|content|net)[\\\/].*'), | 670 white_list=(r'^(android_webview|base|content|net)[\\\/].*', ), |
| 671 black_list=(_EXCLUDED_PATHS + | 671 black_list=(_EXCLUDED_PATHS + |
| 672 _TEST_CODE_EXCLUDED_PATHS + | 672 _TEST_CODE_EXCLUDED_PATHS + |
| 673 input_api.DEFAULT_BLACK_LIST)) | 673 input_api.DEFAULT_BLACK_LIST)) |
| 674 | 674 |
| 675 pattern = input_api.re.compile('"[^"]*google\.com[^"]*"') | 675 pattern = input_api.re.compile('"[^"]*google\.com[^"]*"') |
| 676 problems = [] # items are (filename, line_number, line) | 676 problems = [] # items are (filename, line_number, line) |
| 677 for f in input_api.AffectedSourceFiles(FilterFile): | 677 for f in input_api.AffectedSourceFiles(FilterFile): |
| 678 for line_num, line in f.ChangedContents(): | 678 for line_num, line in f.ChangedContents(): |
| 679 if pattern.search(line): | 679 if pattern.search(line): |
| 680 problems.append((f.LocalPath(), line_num, line)) | 680 problems.append((f.LocalPath(), line_num, line)) |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 'win_aura', | 872 'win_aura', |
| 873 'win_rel', | 873 'win_rel', |
| 874 ] | 874 ] |
| 875 | 875 |
| 876 # Match things like path/aura/file.cc and path/file_aura.cc. | 876 # Match things like path/aura/file.cc and path/file_aura.cc. |
| 877 # Same for chromeos. | 877 # Same for chromeos. |
| 878 if any(re.search('[/_](aura|chromeos)', f) for f in files): | 878 if any(re.search('[/_](aura|chromeos)', f) for f in files): |
| 879 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] | 879 trybots += ['linux_chromeos_clang:compile', 'linux_chromeos_asan'] |
| 880 | 880 |
| 881 return trybots | 881 return trybots |
| OLD | NEW |