Upstream: Ignore android.util.Log usage in WebAPK code
Code in //chrome/android/webapk cannot depend on anything in Chromium including
//base.
Do not throw a PRESUMBIT error for android.util.Log usage in
//chrome/android/webapk
BUG=609122
Review-Url: https://codereview.chromium.org/1980693002
Cr-Commit-Position: refs/heads/master@{#393830}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 4e5e5c3..7672a57e 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1439,6 +1439,13 @@
- Are using 'TAG' as variable name for the tags (warn)
- Are using a tag that is shorter than 20 characters (error)
"""
+
+ # Do not check format of logs in //chrome/android/webapk because
+ # //chrome/android/webapk cannot depend on //base
+ cr_log_check_excluded_paths = [
+ r"^chrome[\\\/]android[\\\/]webapk[\\\/].*",
+ ]
+
cr_log_import_pattern = input_api.re.compile(
r'^import org\.chromium\.base\.Log;$', input_api.re.MULTILINE)
class_in_base_pattern = input_api.re.compile(
@@ -1453,7 +1460,8 @@
REF_MSG = ('See docs/android_logging.md '
'or contact [email protected] for more info.')
- sources = lambda x: input_api.FilterSourceFile(x, white_list=(r'.*\.java$',))
+ sources = lambda x: input_api.FilterSourceFile(x, white_list=(r'.*\.java$',),
+ black_list=cr_log_check_excluded_paths)
tag_decl_errors = []
tag_length_errors = []