From 7291750ae258773233f671ae7c93a5bc4a388831 Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Tue, 28 Jul 2020 16:20:00 +0000 Subject: [PATCH] presubmit: Add dirmd_bin to CheckDirMetadataFormat. dirmd is not available on bots, so we'll need to receive the path where it's available as an argument. Bug: 1102997 Change-Id: I8966225d8ded3eb06c504797280baaa6c6c64a9a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2321510 Reviewed-by: Nodir Turakulov Commit-Queue: Edward Lesmes --- presubmit_canned_checks.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 571772731..59a32386d 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1028,7 +1028,7 @@ def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings, return [] -def CheckDirMetadataFormat(input_api, output_api): +def CheckDirMetadataFormat(input_api, output_api, dirmd_bin=None): # TODO(crbug.com/1102997): Remove OWNERS once DIR_METADATA migration is # complete. file_filter = lambda f: ( @@ -1042,13 +1042,12 @@ def CheckDirMetadataFormat(input_api, output_api): return [] name = 'Validate metadata in OWNERS and DIR_METADATA files' - dirmd_bin = 'dirmd.bat' if input_api.is_windows else 'dirmd' kwargs = {} - if input_api.is_windows: - # Needed to be able to resolve 'dirmd.bat'. - kwargs['shell'] = True + if dirmd_bin is None: + dirmd_bin = 'dirmd.bat' if input_api.is_windows else 'dirmd' cmd = [dirmd_bin, 'validate'] + sorted(affected_files) + return [input_api.Command( name, cmd, kwargs, output_api.PresubmitError)]