Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: PRESUBMIT.py

Issue 1686663002: Add presubmit warning about deprecated compiled_resources.gyp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: double down Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 added_files = filter(lambda f: f.Action() == 'A', input_api.AffectedFiles())
1551 added_paths = map(lambda f: f.LocalPath(), added_files)
M-A Ruel 2016/02/09 20:27:59 added = [ f.LocalPath() for f in input_api.Affec
Dan Beam 2016/02/09 20:33:25 Done.
1552 is_compiled_resource = lambda fp: fp.endswith('compiled_resources.gyp')
1553 added_compiled_resources = filter(is_compiled_resource, added_paths)
1554
M-A Ruel 2016/02/09 20:27:59 if not added_compiled_resources: return [] is m
Dan Beam 2016/02/09 20:33:25 Done.
1555 return [output_api.PresubmitError(
1556 "Found new compiled_resources.gyp files:\n%s\n\n"
1557 "compiled_resources.gyp files are deprecated,\n"
1558 "please use compiled_resources2.gyp instead" %
1559 "\n".join(added_compiled_resources))] if added_compiled_resources else []
1560
1561
1548 _DEPRECATED_CSS = [ 1562 _DEPRECATED_CSS = [
1549 # Values 1563 # Values
1550 ( "-webkit-box", "flex" ), 1564 ( "-webkit-box", "flex" ),
1551 ( "-webkit-inline-box", "inline-flex" ), 1565 ( "-webkit-inline-box", "inline-flex" ),
1552 ( "-webkit-flex", "flex" ), 1566 ( "-webkit-flex", "flex" ),
1553 ( "-webkit-inline-flex", "inline-flex" ), 1567 ( "-webkit-inline-flex", "inline-flex" ),
1554 ( "-webkit-min-content", "min-content" ), 1568 ( "-webkit-min-content", "min-content" ),
1555 ( "-webkit-max-content", "max-content" ), 1569 ( "-webkit-max-content", "max-content" ),
1556 1570
1557 # Properties 1571 # Properties
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 results.extend(_CheckForAnonymousVariables(input_api, output_api)) 1683 results.extend(_CheckForAnonymousVariables(input_api, output_api))
1670 results.extend(_CheckCygwinShell(input_api, output_api)) 1684 results.extend(_CheckCygwinShell(input_api, output_api))
1671 results.extend(_CheckUserActionUpdate(input_api, output_api)) 1685 results.extend(_CheckUserActionUpdate(input_api, output_api))
1672 results.extend(_CheckNoDeprecatedCSS(input_api, output_api)) 1686 results.extend(_CheckNoDeprecatedCSS(input_api, output_api))
1673 results.extend(_CheckNoDeprecatedJS(input_api, output_api)) 1687 results.extend(_CheckNoDeprecatedJS(input_api, output_api))
1674 results.extend(_CheckParseErrors(input_api, output_api)) 1688 results.extend(_CheckParseErrors(input_api, output_api))
1675 results.extend(_CheckForIPCRules(input_api, output_api)) 1689 results.extend(_CheckForIPCRules(input_api, output_api))
1676 results.extend(_CheckForCopyrightedCode(input_api, output_api)) 1690 results.extend(_CheckForCopyrightedCode(input_api, output_api))
1677 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) 1691 results.extend(_CheckForWindowsLineEndings(input_api, output_api))
1678 results.extend(_CheckSingletonInHeaders(input_api, output_api)) 1692 results.extend(_CheckSingletonInHeaders(input_api, output_api))
1693 results.extend(_CheckNoDeprecatedCompiledResourcesGYP(input_api, output_api))
1679 1694
1680 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): 1695 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()):
1681 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( 1696 results.extend(input_api.canned_checks.RunUnitTestsInDirectory(
1682 input_api, output_api, 1697 input_api, output_api,
1683 input_api.PresubmitLocalPath(), 1698 input_api.PresubmitLocalPath(),
1684 whitelist=[r'^PRESUBMIT_test\.py$'])) 1699 whitelist=[r'^PRESUBMIT_test\.py$']))
1685 return results 1700 return results
1686 1701
1687 1702
1688 def _CheckAuthorizedAuthor(input_api, output_api): 1703 def _CheckAuthorizedAuthor(input_api, output_api):
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 results.extend(input_api.canned_checks.CheckTreeIsOpen( 1965 results.extend(input_api.canned_checks.CheckTreeIsOpen(
1951 input_api, 1966 input_api,
1952 output_api, 1967 output_api,
1953 json_url='http://chromium-status.appspot.com/current?format=json')) 1968 json_url='http://chromium-status.appspot.com/current?format=json'))
1954 1969
1955 results.extend(input_api.canned_checks.CheckChangeHasBugField( 1970 results.extend(input_api.canned_checks.CheckChangeHasBugField(
1956 input_api, output_api)) 1971 input_api, output_api))
1957 results.extend(input_api.canned_checks.CheckChangeHasDescription( 1972 results.extend(input_api.canned_checks.CheckChangeHasDescription(
1958 input_api, output_api)) 1973 input_api, output_api))
1959 return results 1974 return results
OLDNEW
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698