| 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 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1725 | 1725 |
| 1726 if not useless_fwd_decls: | 1726 if not useless_fwd_decls: |
| 1727 continue | 1727 continue |
| 1728 | 1728 |
| 1729 for line in f.GenerateScmDiff().splitlines(): | 1729 for line in f.GenerateScmDiff().splitlines(): |
| 1730 if (line.startswith('-') and not line.startswith('--') or | 1730 if (line.startswith('-') and not line.startswith('--') or |
| 1731 line.startswith('+') and not line.startswith('++')): | 1731 line.startswith('+') and not line.startswith('++')): |
| 1732 for decl in useless_fwd_decls: | 1732 for decl in useless_fwd_decls: |
| 1733 if input_api.re.search(r'\b%s\b' % decl, line[1:]): | 1733 if input_api.re.search(r'\b%s\b' % decl, line[1:]): |
| 1734 results.append(output_api.PresubmitPromptWarning( | 1734 results.append(output_api.PresubmitPromptWarning( |
| 1735 '%s: %s forward declaration is becoming useless' % | 1735 '%s: %s forward declaration is no longer needed' % |
| 1736 (f.LocalPath(), decl))) | 1736 (f.LocalPath(), decl))) |
| 1737 useless_fwd_decls.remove(decl) | 1737 useless_fwd_decls.remove(decl) |
| 1738 | 1738 |
| 1739 return results | 1739 return results |
| 1740 | 1740 |
| 1741 | 1741 |
| 1742 def _CheckAndroidToastUsage(input_api, output_api): | 1742 def _CheckAndroidToastUsage(input_api, output_api): |
| 1743 """Checks that code uses org.chromium.ui.widget.Toast instead of | 1743 """Checks that code uses org.chromium.ui.widget.Toast instead of |
| 1744 android.widget.Toast (Chromium Toast doesn't force hardware | 1744 android.widget.Toast (Chromium Toast doesn't force hardware |
| 1745 acceleration on low-end devices, saving memory). | 1745 acceleration on low-end devices, saving memory). |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 output_api, | 2491 output_api, |
| 2492 json_url='http://chromium-status.appspot.com/current?format=json')) | 2492 json_url='http://chromium-status.appspot.com/current?format=json')) |
| 2493 | 2493 |
| 2494 results.extend( | 2494 results.extend( |
| 2495 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) | 2495 input_api.canned_checks.CheckPatchFormatted(input_api, output_api)) |
| 2496 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2496 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 2497 input_api, output_api)) | 2497 input_api, output_api)) |
| 2498 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2498 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 2499 input_api, output_api)) | 2499 input_api, output_api)) |
| 2500 return results | 2500 return results |
| OLD | NEW |