|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
import os as _os
|
|
|
|
|
from warnings import warn
|
|
|
|
|
_HERE = _os.path.dirname(_os.path.abspath(__file__))
|
|
|
|
|
|
|
|
|
|
# These filters will be disabled if callers do not explicitly supply a
|
|
|
|
@ -108,8 +109,9 @@ def CheckAuthorizedAuthor(input_api, output_api, bot_allowlist=None,
|
|
|
|
|
"""For non-googler/chromites committers, verify the author's email address is
|
|
|
|
|
in AUTHORS.
|
|
|
|
|
"""
|
|
|
|
|
# TODO(https://crbug.com/1098560): Add warnings before removing BC.
|
|
|
|
|
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
|
|
|
|
if bot_allowlist is None:
|
|
|
|
|
warn('Use bot_allowlist in CheckAuthorizedAuthor')
|
|
|
|
|
bot_allowlist = bot_whitelist
|
|
|
|
|
if input_api.is_committing:
|
|
|
|
|
error_type = output_api.PresubmitError
|
|
|
|
@ -624,10 +626,12 @@ def GetUnitTestsInDirectory(
|
|
|
|
|
It's mainly a wrapper for RunUnitTests. Use allowlist and blocklist to filter
|
|
|
|
|
tests accordingly.
|
|
|
|
|
"""
|
|
|
|
|
# TODO(https://crbug.com/1098560): Add warnings before removing bc.
|
|
|
|
|
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
|
|
|
|
if files_to_check is None:
|
|
|
|
|
warn('Use files_to_check in GetUnitTestsInDirectory')
|
|
|
|
|
files_to_check = allowlist or whitelist
|
|
|
|
|
if files_to_skip is None:
|
|
|
|
|
warn('Use files_to_skip in GetUnitTestsInDirectory')
|
|
|
|
|
files_to_skip = blocklist or blacklist
|
|
|
|
|
|
|
|
|
|
unit_tests = []
|
|
|
|
@ -722,10 +726,12 @@ def GetUnitTestsRecursively(input_api, output_api, directory,
|
|
|
|
|
Restricts itself to only find files within the Change's source repo, not
|
|
|
|
|
dependencies.
|
|
|
|
|
"""
|
|
|
|
|
# TODO(https://crbug.com/1098560): Add warnings before removing BC.
|
|
|
|
|
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
|
|
|
|
if files_to_check is None:
|
|
|
|
|
warn('Use files_to_check in GetUnitTestsRecursively')
|
|
|
|
|
files_to_check = allowlist or whitelist
|
|
|
|
|
if files_to_skip is None:
|
|
|
|
|
warn('Use files_to_skip in GetUnitTestsRecursively')
|
|
|
|
|
files_to_skip = blocklist or blacklist
|
|
|
|
|
assert files_to_check is not None
|
|
|
|
|
assert files_to_skip is not None
|
|
|
|
@ -870,6 +876,13 @@ def GetPylint(input_api, output_api, files_to_check=None, files_to_skip=None,
|
|
|
|
|
|
|
|
|
|
The default files_to_check enforces looking only at *.py files.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
|
|
|
|
if allow_list or white_list:
|
|
|
|
|
warn('Use files_to_check in GetPylint')
|
|
|
|
|
if block_list or black_list:
|
|
|
|
|
warn('Use files_to_skip in GetPylint')
|
|
|
|
|
|
|
|
|
|
files_to_check = tuple(files_to_check or allow_list or white_list or
|
|
|
|
|
(r'.*\.py$',))
|
|
|
|
|
files_to_skip = tuple(files_to_skip or block_list or black_list or
|
|
|
|
|