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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 | 1538 |
1539 if files: | 1539 if files: |
1540 return [ output_api.PresubmitError( | 1540 return [ output_api.PresubmitError( |
1541 'Found base::Singleton<T> in the following header files.\n' + | 1541 'Found base::Singleton<T> in the following header files.\n' + |
1542 'Please move them to an appropriate source file so that the ' + | 1542 'Please move them to an appropriate source file so that the ' + |
1543 'template gets instantiated in a single compilation unit.', | 1543 'template gets instantiated in a single compilation unit.', |
1544 files) ] | 1544 files) ] |
1545 return [] | 1545 return [] |
1546 | 1546 |
1547 | 1547 |
| 1548 def _CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api): |
| 1549 """Checks for old style compiled_resources.gyp files.""" |
| 1550 is_compiled_resource = lambda fp: fp.endswith('compiled_resources.gyp') |
| 1551 |
| 1552 added_compiled_resources = filter(is_compiled_resource, [ |
| 1553 f.LocalPath() for f in input_api.AffectedFiles() if f.Action() == 'A' |
| 1554 ]) |
| 1555 |
| 1556 if not added_compiled_resources: |
| 1557 return [] |
| 1558 |
| 1559 return [output_api.PresubmitError( |
| 1560 "Found new compiled_resources.gyp files:\n%s\n\n" |
| 1561 "compiled_resources.gyp files are deprecated,\n" |
| 1562 "please use compiled_resources2.gyp instead" % |
| 1563 "\n".join(added_compiled_resources))] |
| 1564 |
| 1565 |
1548 _DEPRECATED_CSS = [ | 1566 _DEPRECATED_CSS = [ |
1549 # Values | 1567 # Values |
1550 ( "-webkit-box", "flex" ), | 1568 ( "-webkit-box", "flex" ), |
1551 ( "-webkit-inline-box", "inline-flex" ), | 1569 ( "-webkit-inline-box", "inline-flex" ), |
1552 ( "-webkit-flex", "flex" ), | 1570 ( "-webkit-flex", "flex" ), |
1553 ( "-webkit-inline-flex", "inline-flex" ), | 1571 ( "-webkit-inline-flex", "inline-flex" ), |
1554 ( "-webkit-min-content", "min-content" ), | 1572 ( "-webkit-min-content", "min-content" ), |
1555 ( "-webkit-max-content", "max-content" ), | 1573 ( "-webkit-max-content", "max-content" ), |
1556 | 1574 |
1557 # Properties | 1575 # Properties |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 results.extend(_CheckForAnonymousVariables(input_api, output_api)) | 1687 results.extend(_CheckForAnonymousVariables(input_api, output_api)) |
1670 results.extend(_CheckCygwinShell(input_api, output_api)) | 1688 results.extend(_CheckCygwinShell(input_api, output_api)) |
1671 results.extend(_CheckUserActionUpdate(input_api, output_api)) | 1689 results.extend(_CheckUserActionUpdate(input_api, output_api)) |
1672 results.extend(_CheckNoDeprecatedCSS(input_api, output_api)) | 1690 results.extend(_CheckNoDeprecatedCSS(input_api, output_api)) |
1673 results.extend(_CheckNoDeprecatedJS(input_api, output_api)) | 1691 results.extend(_CheckNoDeprecatedJS(input_api, output_api)) |
1674 results.extend(_CheckParseErrors(input_api, output_api)) | 1692 results.extend(_CheckParseErrors(input_api, output_api)) |
1675 results.extend(_CheckForIPCRules(input_api, output_api)) | 1693 results.extend(_CheckForIPCRules(input_api, output_api)) |
1676 results.extend(_CheckForCopyrightedCode(input_api, output_api)) | 1694 results.extend(_CheckForCopyrightedCode(input_api, output_api)) |
1677 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) | 1695 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) |
1678 results.extend(_CheckSingletonInHeaders(input_api, output_api)) | 1696 results.extend(_CheckSingletonInHeaders(input_api, output_api)) |
| 1697 results.extend(_CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api)) |
1679 | 1698 |
1680 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): | 1699 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): |
1681 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 1700 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
1682 input_api, output_api, | 1701 input_api, output_api, |
1683 input_api.PresubmitLocalPath(), | 1702 input_api.PresubmitLocalPath(), |
1684 whitelist=[r'^PRESUBMIT_test\.py$'])) | 1703 whitelist=[r'^PRESUBMIT_test\.py$'])) |
1685 return results | 1704 return results |
1686 | 1705 |
1687 | 1706 |
1688 def _CheckAuthorizedAuthor(input_api, output_api): | 1707 def _CheckAuthorizedAuthor(input_api, output_api): |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 1969 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
1951 input_api, | 1970 input_api, |
1952 output_api, | 1971 output_api, |
1953 json_url='http://chromium-status.appspot.com/current?format=json')) | 1972 json_url='http://chromium-status.appspot.com/current?format=json')) |
1954 | 1973 |
1955 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 1974 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
1956 input_api, output_api)) | 1975 input_api, output_api)) |
1957 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 1976 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
1958 input_api, output_api)) | 1977 input_api, output_api)) |
1959 return results | 1978 return results |
OLD | NEW |