mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user