Commit a58287b8 authored by Edward Lesmes's avatar Edward Lesmes Committed by LUCI CQ

presubmit: Also validate metadata in OWNERS files.

Bug: 1102997
Change-Id: Id847129d320004fcd121941f2e14cf9ad56ab4a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2318335Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 9e8b8f31
......@@ -1029,7 +1029,10 @@ def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings,
def CheckDirMetadataFormat(input_api, output_api):
file_filter = lambda f: input_api.basename(f.LocalPath()) == 'DIR_METADATA'
# TODO(crbug.com/1102997): Remove OWNERS once DIR_METADATA migration is
# complete.
file_filter = lambda f: (
input_api.basename(f.LocalPath()) in ('DIR_METADATA', 'OWNERS'))
affected_files = set([
f.LocalPath()
for f in input_api.change.AffectedFiles(
......@@ -1038,7 +1041,7 @@ def CheckDirMetadataFormat(input_api, output_api):
if not affected_files:
return []
name = 'Validate DIR_METADATA files'
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:
......
......@@ -2559,10 +2559,12 @@ the current line as well!
'a/DIR_METADATA': ('M', ''),
'a/b/OWNERS': ('M', ''),
'c/DIR_METADATA': ('D', ''),
'd/unrelated': ('M', ''),
})
dirmd_bin = 'dirmd.bat' if input_api.is_windows else 'dirmd'
expected_cmd = [dirmd_bin, 'validate', 'DIR_METADATA', 'a/DIR_METADATA']
expected_cmd = [
dirmd_bin, 'validate', 'DIR_METADATA', 'a/DIR_METADATA', 'a/b/OWNERS']
commands = presubmit_canned_checks.CheckDirMetadataFormat(
input_api, presubmit.OutputApi)
......
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