commit | 9e6d60307a9826050c212425141746a8f2020f17 | [log] [tgz] |
---|---|---|
author | Sky Malice <[email protected]> | Thu Oct 15 22:49:55 2020 |
committer | Commit Bot <[email protected]> | Thu Oct 15 22:49:55 2020 |
tree | 86602cace3688cb4f441c1d4ddb7bec1f276b82f | |
parent | c35e45e89c590f029f632c309ba27bf05e57ede5 [diff] [blame] |
Stop PRESUBMIT alarming on @VisibleForTesting(). Update special handing in ForTest PRESUBMIT checking to make sure common Android annotation @VisibleForTesting is not flagged. This annotation typically means something in production code has a more permissive visibility setting (such as protected or public) so that a test can access it. The ForTest PRESUBMIT check is not applicable to this annotation. For more information about @VisibleForTesting annotation see https://developer.android.com/reference/androidx/annotation/VisibleForTesting Bug: 1138976 Change-Id: Ic345bfe8e5c283a8826e17c3209f6768a281151d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2476515 Commit-Queue: Sky Malice <[email protected]> Reviewed-by: who/bttk <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Cr-Commit-Position: refs/heads/master@{#817717}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 85b55f4..47bace3 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1493,7 +1493,7 @@ # Describes an occurrence of "ForTest*" inside a // comment. comment_re = input_api.re.compile(r'//.*%s' % name_pattern) # Describes @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) - annotation_re = input_api.re.compile(r'@VisibleForTesting\(otherwise') + annotation_re = input_api.re.compile(r'@VisibleForTesting\(') # Catch calls. inclusion_re = input_api.re.compile(r'(%s)\s*\(' % name_pattern) # Ignore definitions. (Comments are ignored separately.)