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 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 | 2052 |
2053 if files: | 2053 if files: |
2054 return [output_api.PresubmitError( | 2054 return [output_api.PresubmitError( |
2055 'Found base::Singleton<T> in the following header files.\n' + | 2055 'Found base::Singleton<T> in the following header files.\n' + |
2056 'Please move them to an appropriate source file so that the ' + | 2056 'Please move them to an appropriate source file so that the ' + |
2057 'template gets instantiated in a single compilation unit.', | 2057 'template gets instantiated in a single compilation unit.', |
2058 files) ] | 2058 files) ] |
2059 return [] | 2059 return [] |
2060 | 2060 |
2061 | 2061 |
| 2062 def _CheckNoDeprecatedCompiledResourcesGyp(input_api, output_api): |
| 2063 """Checks for old style compiled_resources.gyp files.""" |
| 2064 is_compiled_resource = lambda fp: fp.endswith('compiled_resources.gyp') |
| 2065 |
| 2066 added_compiled_resources = filter(is_compiled_resource, [ |
| 2067 f.LocalPath() for f in input_api.AffectedFiles() if f.Action() == 'A' |
| 2068 ]) |
| 2069 |
| 2070 if not added_compiled_resources: |
| 2071 return [] |
| 2072 |
| 2073 return [output_api.PresubmitError( |
| 2074 "Found new compiled_resources.gyp files:\n%s\n\n" |
| 2075 "compiled_resources.gyp files are deprecated,\n" |
| 2076 "please use compiled_resources2.gyp instead:\n" |
| 2077 "https://chromium.googlesource.com/chromium/src/+/master/docs/closure_comp
ilation.md" |
| 2078 % |
| 2079 "\n".join(added_compiled_resources))] |
| 2080 |
| 2081 |
2062 _DEPRECATED_CSS = [ | 2082 _DEPRECATED_CSS = [ |
2063 # Values | 2083 # Values |
2064 ( "-webkit-box", "flex" ), | 2084 ( "-webkit-box", "flex" ), |
2065 ( "-webkit-inline-box", "inline-flex" ), | 2085 ( "-webkit-inline-box", "inline-flex" ), |
2066 ( "-webkit-flex", "flex" ), | 2086 ( "-webkit-flex", "flex" ), |
2067 ( "-webkit-inline-flex", "inline-flex" ), | 2087 ( "-webkit-inline-flex", "inline-flex" ), |
2068 ( "-webkit-min-content", "min-content" ), | 2088 ( "-webkit-min-content", "min-content" ), |
2069 ( "-webkit-max-content", "max-content" ), | 2089 ( "-webkit-max-content", "max-content" ), |
2070 | 2090 |
2071 # Properties | 2091 # Properties |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 results.extend(_CheckSpamLogging(input_api, output_api)) | 2227 results.extend(_CheckSpamLogging(input_api, output_api)) |
2208 results.extend(_CheckForAnonymousVariables(input_api, output_api)) | 2228 results.extend(_CheckForAnonymousVariables(input_api, output_api)) |
2209 results.extend(_CheckCygwinShell(input_api, output_api)) | 2229 results.extend(_CheckCygwinShell(input_api, output_api)) |
2210 results.extend(_CheckUserActionUpdate(input_api, output_api)) | 2230 results.extend(_CheckUserActionUpdate(input_api, output_api)) |
2211 results.extend(_CheckNoDeprecatedCss(input_api, output_api)) | 2231 results.extend(_CheckNoDeprecatedCss(input_api, output_api)) |
2212 results.extend(_CheckNoDeprecatedJs(input_api, output_api)) | 2232 results.extend(_CheckNoDeprecatedJs(input_api, output_api)) |
2213 results.extend(_CheckParseErrors(input_api, output_api)) | 2233 results.extend(_CheckParseErrors(input_api, output_api)) |
2214 results.extend(_CheckForIPCRules(input_api, output_api)) | 2234 results.extend(_CheckForIPCRules(input_api, output_api)) |
2215 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) | 2235 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) |
2216 results.extend(_CheckSingletonInHeaders(input_api, output_api)) | 2236 results.extend(_CheckSingletonInHeaders(input_api, output_api)) |
| 2237 results.extend(_CheckNoDeprecatedCompiledResourcesGyp(input_api, output_api)) |
2217 results.extend(_CheckPydepsNeedsUpdating(input_api, output_api)) | 2238 results.extend(_CheckPydepsNeedsUpdating(input_api, output_api)) |
2218 results.extend(_CheckJavaStyle(input_api, output_api)) | 2239 results.extend(_CheckJavaStyle(input_api, output_api)) |
2219 results.extend(_CheckIpcOwners(input_api, output_api)) | 2240 results.extend(_CheckIpcOwners(input_api, output_api)) |
2220 results.extend(_CheckUselessForwardDeclarations(input_api, output_api)) | 2241 results.extend(_CheckUselessForwardDeclarations(input_api, output_api)) |
2221 results.extend(_CheckForRiskyJsFeatures(input_api, output_api)) | 2242 results.extend(_CheckForRiskyJsFeatures(input_api, output_api)) |
2222 | 2243 |
2223 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): | 2244 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): |
2224 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 2245 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
2225 input_api, output_api, | 2246 input_api, output_api, |
2226 input_api.PresubmitLocalPath(), | 2247 input_api.PresubmitLocalPath(), |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 output_api, | 2491 output_api, |
2471 json_url='http://chromium-status.appspot.com/current?format=json')) | 2492 json_url='http://chromium-status.appspot.com/current?format=json')) |
2472 | 2493 |
2473 results.extend( | 2494 results.extend( |
2474 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) | 2495 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) |
2475 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2496 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
2476 input_api, output_api)) | 2497 input_api, output_api)) |
2477 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2498 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
2478 input_api, output_api)) | 2499 input_api, output_api)) |
2479 return results | 2500 return results |
OLD | NEW |