src/nitpick/project.py
def climb_directory_tree(starting_path: PathOrStr, file_patterns: Iterable[str]) -> Set[Path]:  # TODO: add unit test
    """Climb the directory tree looking for file patterns."""
    current_dir: Path = Path(starting_path).absolute()
    while current_dir.anchor != str(current_dir):
        for root_file in file_patterns:
            found_files = list(current_dir.glob(root_file))
            if found_files:
                return set(found_files)
        current_dir = current_dir.parent
    return set()
Climb the directory tree looking for file patterns.
Climb the directory tree looking for file patterns.
Climb the directory tree looking for file patterns .
def climb_directory_tree(starting_path: PathOrStr, file_patterns: Iterable[str]) -> Set[Path]:  
    current_dir: Path = Path(starting_path).absolute()
    while current_dir.anchor != str(current_dir):
        for root_file in file_patterns:
            found_files = list(current_dir.glob(root_file))
            if found_files:
                return set(found_files)
        current_dir = current_dir.parent
    return set()
def climb_directory_tree ( starting_path : PathOrStr , file_patterns : Iterable [ str ] ) -> Set [ Path ] : current_dir : Path = Path ( starting_path ) . absolute ( ) while current_dir . anchor != str ( current_dir ) : for root_file in file_patterns : found_files = list ( current_dir . glob ( root_file ) ) if found_files : return set ( found_files ) current_dir = current_dir . parent return set ( )
Climb the directory tree looking for file patterns.
Climb the directory tree looking for file patterns .
# TODO: add unit test """Climb the directory tree looking for file patterns."""
starting_path
PathOrStr
file_patterns
Iterable[str]