mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Revert "Warn when non-inclusive parameters are used"
This reverts commit 149a3b7581.
Reason for revert: warnings are issued if no optional parameters
are passed.
Original change's description:
> Warn when non-inclusive parameters are used
>
> R=apolito@google.com
>
> Bug: 1098560
> Change-Id: Iabc2a5d89a6af1418c1228f3c09eacbbd799b5c7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2355112
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
TBR=apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1098560
Change-Id: Ib0f188de90121c692f5c0d7271938ee312917fd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2376042
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This commit is contained in:
@@ -91,8 +91,8 @@ def CommonChecks(input_api, output_api, tests_to_skip_list, run_on_python3):
|
||||
input_api,
|
||||
output_api,
|
||||
'tests',
|
||||
files_to_check=test_to_run_list,
|
||||
files_to_skip=tests_to_skip_list,
|
||||
allowlist=test_to_run_list,
|
||||
blocklist=tests_to_skip_list,
|
||||
run_on_python3=run_on_python3))
|
||||
|
||||
# Validate CIPD manifests.
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
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
|
||||
@@ -109,9 +108,8 @@ 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): Remove non inclusive parameter names.
|
||||
# TODO(https://crbug.com/1098560): Add warnings before removing BC.
|
||||
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
|
||||
@@ -626,12 +624,10 @@ def GetUnitTestsInDirectory(
|
||||
It's mainly a wrapper for RunUnitTests. Use allowlist and blocklist to filter
|
||||
tests accordingly.
|
||||
"""
|
||||
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
||||
# TODO(https://crbug.com/1098560): Add warnings before removing bc.
|
||||
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 = []
|
||||
@@ -726,12 +722,10 @@ 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): Remove non inclusive parameter names.
|
||||
# TODO(https://crbug.com/1098560): Add warnings before removing BC.
|
||||
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
|
||||
@@ -876,13 +870,6 @@ 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
|
||||
|
||||
@@ -730,12 +730,10 @@ class InputApi(object):
|
||||
|
||||
Note: Copy-paste this function to suit your needs or use a lambda function.
|
||||
"""
|
||||
# TODO(https://crbug.com/1098560): Remove non inclusive parameter names.
|
||||
if files_to_check is None and (allow_list or white_list):
|
||||
warn('Use files_to_check in FilterSourceFile')
|
||||
# TODO(https://crbug.com/1098560): Add warnings before removing bc.
|
||||
if files_to_check is None:
|
||||
files_to_check = allow_list or white_list
|
||||
if files_to_skip is None and (block_list or black_list):
|
||||
warn('Use files_to_skip in FilterSourceFile')
|
||||
if files_to_skip is None:
|
||||
files_to_skip = block_list or black_list
|
||||
|
||||
if files_to_check is None:
|
||||
|
||||
Reference in New Issue
Block a user