| 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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 results.extend(_CheckForAnonymousVariables(input_api, output_api)) | 1490 results.extend(_CheckForAnonymousVariables(input_api, output_api)) |
| 1491 results.extend(_CheckCygwinShell(input_api, output_api)) | 1491 results.extend(_CheckCygwinShell(input_api, output_api)) |
| 1492 results.extend(_CheckUserActionUpdate(input_api, output_api)) | 1492 results.extend(_CheckUserActionUpdate(input_api, output_api)) |
| 1493 results.extend(_CheckNoDeprecatedCSS(input_api, output_api)) | 1493 results.extend(_CheckNoDeprecatedCSS(input_api, output_api)) |
| 1494 results.extend(_CheckNoDeprecatedJS(input_api, output_api)) | 1494 results.extend(_CheckNoDeprecatedJS(input_api, output_api)) |
| 1495 results.extend(_CheckParseErrors(input_api, output_api)) | 1495 results.extend(_CheckParseErrors(input_api, output_api)) |
| 1496 results.extend(_CheckForIPCRules(input_api, output_api)) | 1496 results.extend(_CheckForIPCRules(input_api, output_api)) |
| 1497 results.extend(_CheckForCopyrightedCode(input_api, output_api)) | 1497 results.extend(_CheckForCopyrightedCode(input_api, output_api)) |
| 1498 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) | 1498 results.extend(_CheckForWindowsLineEndings(input_api, output_api)) |
| 1499 results.extend(_CheckSingletonInHeaders(input_api, output_api)) | 1499 results.extend(_CheckSingletonInHeaders(input_api, output_api)) |
| 1500 results.extend(_CheckNoNewUtilLogUsage(input_api, output_api)) | |
| 1501 | 1500 |
| 1502 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): | 1501 if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): |
| 1503 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( | 1502 results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |
| 1504 input_api, output_api, | 1503 input_api, output_api, |
| 1505 input_api.PresubmitLocalPath(), | 1504 input_api.PresubmitLocalPath(), |
| 1506 whitelist=[r'^PRESUBMIT_test\.py$'])) | 1505 whitelist=[r'^PRESUBMIT_test\.py$'])) |
| 1507 return results | 1506 return results |
| 1508 | 1507 |
| 1509 | 1508 |
| 1510 def _CheckAuthorizedAuthor(input_api, output_api): | 1509 def _CheckAuthorizedAuthor(input_api, output_api): |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 | 1717 |
| 1719 | 1718 |
| 1720 def CheckChangeOnUpload(input_api, output_api): | 1719 def CheckChangeOnUpload(input_api, output_api): |
| 1721 results = [] | 1720 results = [] |
| 1722 results.extend(_CommonChecks(input_api, output_api)) | 1721 results.extend(_CommonChecks(input_api, output_api)) |
| 1723 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) | 1722 results.extend(_CheckValidHostsInDEPS(input_api, output_api)) |
| 1724 results.extend(_CheckJavaStyle(input_api, output_api)) | 1723 results.extend(_CheckJavaStyle(input_api, output_api)) |
| 1725 results.extend( | 1724 results.extend( |
| 1726 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) | 1725 input_api.canned_checks.CheckGNFormatted(input_api, output_api)) |
| 1727 results.extend(_CheckUmaHistogramChanges(input_api, output_api)) | 1726 results.extend(_CheckUmaHistogramChanges(input_api, output_api)) |
| 1727 results.extend(_CheckNoNewUtilLogUsage(input_api, output_api)) |
| 1728 return results | 1728 return results |
| 1729 | 1729 |
| 1730 | 1730 |
| 1731 def GetTryServerMasterForBot(bot): | 1731 def GetTryServerMasterForBot(bot): |
| 1732 """Returns the Try Server master for the given bot. | 1732 """Returns the Try Server master for the given bot. |
| 1733 | 1733 |
| 1734 It tries to guess the master from the bot name, but may still fail | 1734 It tries to guess the master from the bot name, but may still fail |
| 1735 and return None. There is no longer a default master. | 1735 and return None. There is no longer a default master. |
| 1736 """ | 1736 """ |
| 1737 # Potentially ambiguous bot names are listed explicitly. | 1737 # Potentially ambiguous bot names are listed explicitly. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 # Explicitly iterate over copies of dicts since we mutate them. | 1803 # Explicitly iterate over copies of dicts since we mutate them. |
| 1804 for master in builders.keys(): | 1804 for master in builders.keys(): |
| 1805 for builder in builders[master].keys(): | 1805 for builder in builders[master].keys(): |
| 1806 # Do not trigger presubmit builders, since they're likely to fail | 1806 # Do not trigger presubmit builders, since they're likely to fail |
| 1807 # (e.g. OWNERS checks before finished code review), and we're | 1807 # (e.g. OWNERS checks before finished code review), and we're |
| 1808 # running local presubmit anyway. | 1808 # running local presubmit anyway. |
| 1809 if 'presubmit' in builder: | 1809 if 'presubmit' in builder: |
| 1810 builders[master].pop(builder) | 1810 builders[master].pop(builder) |
| 1811 | 1811 |
| 1812 return builders | 1812 return builders |
| OLD | NEW |