| 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 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 | 1430 |
| 1431 return results | 1431 return results |
| 1432 | 1432 |
| 1433 | 1433 |
| 1434 def _CheckAndroidCrLogUsage(input_api, output_api): | 1434 def _CheckAndroidCrLogUsage(input_api, output_api): |
| 1435 """Checks that new logs using org.chromium.base.Log: | 1435 """Checks that new logs using org.chromium.base.Log: |
| 1436 - Are using 'TAG' as variable name for the tags (warn) | 1436 - Are using 'TAG' as variable name for the tags (warn) |
| 1437 - Are using a tag that is shorter than 20 characters (error) | 1437 - Are using a tag that is shorter than 20 characters (error) |
| 1438 """ | 1438 """ |
| 1439 cr_log_check_excluded_paths = [ | 1439 cr_log_check_excluded_paths = [ |
| 1440 r"^web_apks[\\\/]minting_example[\\\/].*", | 1440 r"^webapk[\\\/].*", |
| 1441 ] | 1441 ] |
| 1442 | 1442 |
| 1443 cr_log_import_pattern = input_api.re.compile( | 1443 cr_log_import_pattern = input_api.re.compile( |
| 1444 r'^import org\.chromium\.base\.Log;$', input_api.re.MULTILINE) | 1444 r'^import org\.chromium\.base\.Log;$', input_api.re.MULTILINE) |
| 1445 class_in_base_pattern = input_api.re.compile( | 1445 class_in_base_pattern = input_api.re.compile( |
| 1446 r'^package org\.chromium\.base;$', input_api.re.MULTILINE) | 1446 r'^package org\.chromium\.base;$', input_api.re.MULTILINE) |
| 1447 has_some_log_import_pattern = input_api.re.compile( | 1447 has_some_log_import_pattern = input_api.re.compile( |
| 1448 r'^import .*\.Log;$', input_api.re.MULTILINE) | 1448 r'^import .*\.Log;$', input_api.re.MULTILINE) |
| 1449 # Extract the tag from lines like `Log.d(TAG, "*");` or `Log.d("TAG", "*");` | 1449 # Extract the tag from lines like `Log.d(TAG, "*");` or `Log.d("TAG", "*");` |
| 1450 log_call_pattern = input_api.re.compile(r'^\s*Log\.\w\((?P<tag>\"?\w+\"?)\,') | 1450 log_call_pattern = input_api.re.compile(r'^\s*Log\.\w\((?P<tag>\"?\w+\"?)\,') |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2128 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 2128 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
| 2129 input_api, | 2129 input_api, |
| 2130 output_api, | 2130 output_api, |
| 2131 json_url='http://chromium-status.appspot.com/current?format=json')) | 2131 json_url='http://chromium-status.appspot.com/current?format=json')) |
| 2132 | 2132 |
| 2133 results.extend(input_api.canned_checks.CheckChangeHasBugField( | 2133 results.extend(input_api.canned_checks.CheckChangeHasBugField( |
| 2134 input_api, output_api)) | 2134 input_api, output_api)) |
| 2135 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 2135 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
| 2136 input_api, output_api)) | 2136 input_api, output_api)) |
| 2137 return results | 2137 return results |
| OLD | NEW |