[ssci] PEP8 formatting for metadata directory

All files in metadata/ are new, so they should follow the PEP-8 style.

Change-Id: I5d8424536c3d7b703e6b8087e0e2d70c06a1549c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4834909
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
This commit is contained in:
Anne Redulla
2023-09-04 22:02:36 +00:00
committed by LUCI CQ
parent 693e0b3121
commit 6715758ed9
21 changed files with 1182 additions and 1113 deletions

View File

@@ -12,27 +12,27 @@ _METADATA_FILES = {
def is_metadata_file(path: str) -> bool:
"""Filter for metadata files."""
return os.path.basename(path) in _METADATA_FILES
"""Filter for metadata files."""
return os.path.basename(path) in _METADATA_FILES
def find_metadata_files(root: str) -> List[str]:
"""Finds all metadata files within the given root directory, including
subdirectories.
"""Finds all metadata files within the given root directory,
including subdirectories.
Args:
root: the absolute path to the root directory within which to search.
Args:
root: the absolute path to the root directory within which to
search.
Returns:
the absolute full paths for all the metadata files within the root
directory.
"""
metadata_files = []
for item in os.listdir(root):
full_path = os.path.join(root, item)
if is_metadata_file(item):
metadata_files.append(full_path)
elif os.path.isdir(full_path):
metadata_files.extend(find_metadata_files(full_path))
Returns: the absolute full paths for all the metadata files within
the root directory.
"""
metadata_files = []
for item in os.listdir(root):
full_path = os.path.join(root, item)
if is_metadata_file(item):
metadata_files.append(full_path)
elif os.path.isdir(full_path):
metadata_files.extend(find_metadata_files(full_path))
return metadata_files
return metadata_files