def target_matches_config(target: Path, config: Path) -> bool: correct_suffix = is_config_test_suffix(target) or not is_config_suffix(target) return ( relatively_eq(original_target, target, original_config, config) and target.is_file() and correct_suffix )
def get_config_filenames(original_config: Path) -> List[Path]: configs = list(original_config.rglob("*")) return [ config for config in configs if is_config_suffix(config) and not config.name.startswith(".") and not config.parent.name.startswith(".") ]
def parse_config_folder(loc: Path, relative: bool = False) -> Dict[str, YamlTree]: configs = {} for l in loc.rglob("*"): # Allow manually specified paths with ".", but don't auto-expand them correct_suffix = is_config_suffix(l) if not _is_hidden_config(l.relative_to(loc)) and correct_suffix: if l.is_file(): configs.update(parse_config_at_path(l, loc if relative else None)) return configs