OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 | 5 |
6 """Top-level presubmit script for Skia. | 6 """Top-level presubmit script for Skia. |
7 | 7 |
8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 8 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
9 for more details about the presubmit API built into gcl. | 9 for more details about the presubmit API built into gcl. |
10 """ | 10 """ |
(...skipping 19 matching lines...) Expand all Loading... |
30 'bsalomon@chromium.org', | 30 'bsalomon@chromium.org', |
31 'bsalomon@google.com', | 31 'bsalomon@google.com', |
32 'djsollen@chromium.org', | 32 'djsollen@chromium.org', |
33 'djsollen@google.com', | 33 'djsollen@google.com', |
34 ) | 34 ) |
35 | 35 |
36 AUTHORS_FILE_NAME = 'AUTHORS' | 36 AUTHORS_FILE_NAME = 'AUTHORS' |
37 | 37 |
38 DOCS_PREVIEW_URL = 'https://skia.org/?cl=' | 38 DOCS_PREVIEW_URL = 'https://skia.org/?cl=' |
39 | 39 |
40 # Path to CQ bots feature is described in skbug.com/4364 | 40 # Path to CQ bots feature is described in https://bug.skia.org/4364 |
41 PATH_PREFIX_TO_EXTRA_TRYBOTS = { | 41 PATH_PREFIX_TO_EXTRA_TRYBOTS = { |
42 # pylint: disable=line-too-long | 42 # pylint: disable=line-too-long |
43 'cmake/': 'client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Tryb
ot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot', | 43 'cmake/': 'client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Tryb
ot,Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot', |
44 # pylint: disable=line-too-long | 44 # pylint: disable=line-too-long |
45 'src/opts/': 'client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_N
O_SIMD-Trybot', | 45 'src/opts/': 'client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_N
O_SIMD-Trybot', |
46 | 46 |
47 'include/private/SkAtomics.h': ('client.skia:' | 47 'include/private/SkAtomics.h': ('client.skia:' |
48 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,' | 48 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,' |
49 'Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot' | 49 'Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot' |
50 ), | 50 ), |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 pass | 126 pass |
127 elif line.startswith('#if ') or line.startswith('#ifdef '): | 127 elif line.startswith('#if ') or line.startswith('#ifdef '): |
128 failing_files.append(affected_file_path) | 128 failing_files.append(affected_file_path) |
129 break | 129 break |
130 | 130 |
131 results = [] | 131 results = [] |
132 if failing_files: | 132 if failing_files: |
133 results.append( | 133 results.append( |
134 output_api.PresubmitError( | 134 output_api.PresubmitError( |
135 'The following files have #if or #ifdef before includes:\n%s\n\n' | 135 'The following files have #if or #ifdef before includes:\n%s\n\n' |
136 'See skbug.com/3362 for why this should be fixed.' % | 136 'See https://bug.skia.org/3362 for why this should be fixed.' % |
137 '\n'.join(failing_files))) | 137 '\n'.join(failing_files))) |
138 return results | 138 return results |
139 | 139 |
140 | 140 |
141 def _CopyrightChecks(input_api, output_api, source_file_filter=None): | 141 def _CopyrightChecks(input_api, output_api, source_file_filter=None): |
142 results = [] | 142 results = [] |
143 year_pattern = r'\d{4}' | 143 year_pattern = r'\d{4}' |
144 year_range_pattern = r'%s(-%s)?' % (year_pattern, year_pattern) | 144 year_range_pattern = r'%s(-%s)?' % (year_pattern, year_pattern) |
145 years_pattern = r'%s(,%s)*,?' % (year_range_pattern, year_range_pattern) | 145 years_pattern = r'%s(,%s)*,?' % (year_range_pattern, year_range_pattern) |
146 copyright_pattern = ( | 146 copyright_pattern = ( |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 state and an error if it is in 'Closed' state. | 504 state and an error if it is in 'Closed' state. |
505 """ | 505 """ |
506 results = [] | 506 results = [] |
507 results.extend(_CommonChecks(input_api, output_api)) | 507 results.extend(_CommonChecks(input_api, output_api)) |
508 results.extend( | 508 results.extend( |
509 _CheckTreeStatus(input_api, output_api, json_url=( | 509 _CheckTreeStatus(input_api, output_api, json_url=( |
510 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) | 510 SKIA_TREE_STATUS_URL + '/banner-status?format=json'))) |
511 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) | 511 results.extend(_CheckLGTMsForPublicAPI(input_api, output_api)) |
512 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) | 512 results.extend(_CheckOwnerIsInAuthorsFile(input_api, output_api)) |
513 return results | 513 return results |
OLD | NEW |