Commit a3a014e9 authored by Bruce Dawson's avatar Bruce Dawson Committed by LUCI CQ

Handle mixed slash types in FilterSourceFile

The files_to_skip lists in chrome/android/java/src/PRESUBMIT.py were
not working on Windows because they didn't use the verbose [\\\/]
construct for path separators. Fixing this in FilterSourceFile means
that multiple failures may be fixed simultaneously. The only failures
that this is known to fix are a set of AlertDialog.Builder errors that
were showing up only on Windows.

This addresses the issues that were going to be incorrectly fixed in
crrev.com/c/3606128 (now abandoned).

Bug: 1309977
Change-Id: I7a10483448e00df55e2cbf8bff8bad7a5d8db124
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3609117Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 9856ff0e
......@@ -773,6 +773,11 @@ class InputApi(object):
for item in items:
if self.re.match(item, local_path):
return True
# Handle the cases where the files regex only handles /, but the local
# path uses \.
if self.is_windows and self.re.match(item, local_path.replace(
'\\', '/')):
return True
return False
return (Find(affected_file, files_to_check) and
not Find(affected_file, files_to_skip))
......
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