Commit 635383fb authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

Document filter lists more precisely

The FilterSourceFile comment block said that the filter lists use
regular expressions, but that is not specific enough because .search and
.match have different semantics. crrev.com/c/3679163 added a filter that
only matched on PRESUBMIT.py instead of all of them because of this
difference - better documentation might have avoided this.

The new documentation also makes it clear that Linux-style path
separators in the regex expressions are fine (they have been supported
since crrev.com/c/3609117).

Bug: 1309977
Change-Id: I49d37fbb93ef4a85f143d928a56af8ce22850c76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3889880
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: 's avatarJesse McKenna <jessemckenna@google.com>
parent 2d25dbd1
......@@ -766,8 +766,10 @@ class InputApi(object):
If files_to_check or files_to_skip is None, InputApi.DEFAULT_FILES_TO_CHECK
and InputApi.DEFAULT_FILES_TO_SKIP is used respectively.
The lists will be compiled as regular expression and
AffectedFile.LocalPath() needs to pass both list.
affected_file.LocalPath() needs to re.match an entry in the files_to_check
list and not re.match any entries in the files_to_skip list.
'/' path separators should be used in the regular expressions and will work
on Windows as well as other platforms.
Note: Copy-paste this function to suit your needs or use a lambda function.
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment