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