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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 top-level directories that generally speaking should not hard-code | 877 top-level directories that generally speaking should not hard-code |
878 service URLs (e.g. src/android_webview/, src/content/ and others). | 878 service URLs (e.g. src/android_webview/, src/content/ and others). |
879 """ | 879 """ |
880 return input_api.FilterSourceFile( | 880 return input_api.FilterSourceFile( |
881 affected_file, | 881 affected_file, |
882 white_list=(r'^(android_webview|base|content|net)[\\\/].*', ), | 882 white_list=(r'^(android_webview|base|content|net)[\\\/].*', ), |
883 black_list=(_EXCLUDED_PATHS + | 883 black_list=(_EXCLUDED_PATHS + |
884 _TEST_CODE_EXCLUDED_PATHS + | 884 _TEST_CODE_EXCLUDED_PATHS + |
885 input_api.DEFAULT_BLACK_LIST)) | 885 input_api.DEFAULT_BLACK_LIST)) |
886 | 886 |
887 base_pattern = '"[^"]*google\.com[^"]*"' | 887 base_pattern = ('"[^"]*(google|googleapis|googlezip|googledrive|appspot)' |
| 888 '\.(com|net)[^"]*"') |
888 comment_pattern = input_api.re.compile('//.*%s' % base_pattern) | 889 comment_pattern = input_api.re.compile('//.*%s' % base_pattern) |
889 pattern = input_api.re.compile(base_pattern) | 890 pattern = input_api.re.compile(base_pattern) |
890 problems = [] # items are (filename, line_number, line) | 891 problems = [] # items are (filename, line_number, line) |
891 for f in input_api.AffectedSourceFiles(FilterFile): | 892 for f in input_api.AffectedSourceFiles(FilterFile): |
892 for line_num, line in f.ChangedContents(): | 893 for line_num, line in f.ChangedContents(): |
893 if not comment_pattern.search(line) and pattern.search(line): | 894 if not comment_pattern.search(line) and pattern.search(line): |
894 problems.append((f.LocalPath(), line_num, line)) | 895 problems.append((f.LocalPath(), line_num, line)) |
895 | 896 |
896 if problems: | 897 if problems: |
897 return [output_api.PresubmitPromptOrNotify( | 898 return [output_api.PresubmitPromptOrNotify( |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 for master in masters: | 1951 for master in masters: |
1951 try_config.setdefault(master, {}) | 1952 try_config.setdefault(master, {}) |
1952 for builder in masters[master]: | 1953 for builder in masters[master]: |
1953 # Do not trigger presubmit builders, since they're likely to fail | 1954 # Do not trigger presubmit builders, since they're likely to fail |
1954 # (e.g. OWNERS checks before finished code review), and we're | 1955 # (e.g. OWNERS checks before finished code review), and we're |
1955 # running local presubmit anyway. | 1956 # running local presubmit anyway. |
1956 if 'presubmit' not in builder: | 1957 if 'presubmit' not in builder: |
1957 try_config[master][builder] = ['defaulttests'] | 1958 try_config[master][builder] = ['defaulttests'] |
1958 | 1959 |
1959 return try_config | 1960 return try_config |
OLD | NEW |