Commit c40a012a authored by Baber's avatar Baber
Browse files

refactor: remove root_dir in iglob

parent bfaf24cd
...@@ -291,11 +291,13 @@ def iter_yaml_files(root: Path, ignore=_IGNORE_DIRS) -> Generator[Path, Any, Non ...@@ -291,11 +291,13 @@ def iter_yaml_files(root: Path, ignore=_IGNORE_DIRS) -> Generator[Path, Any, Non
>>> for yaml_file in iter_yaml_files(Path("tasks")): >>> for yaml_file in iter_yaml_files(Path("tasks")):
... print(f"Found task config: {yaml_file}") ... print(f"Found task config: {yaml_file}")
""" """
for p in iglob("**/*.yaml", root_dir=root, recursive=True): for p in iglob(str(root / "**/*.yaml"), recursive=True):
# ignore check # ignore check
if Path(p).parts[0] in ignore: path = Path(p)
# Check if any parent directory is in the ignore list
if any(part in ignore for part in path.parts):
continue continue
yield root / p yield path
class TaskManager: class TaskManager:
......
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