Take a list of files/directories (with support for globbing through the glob library). Where a path/glob matches no file, we still include the raw path in the resulting list. Returns a list of file paths
(paths: Sequence[str])
| 114 | |
| 115 | |
| 116 | def split_and_match_files_list(paths: Sequence[str]) -> list[str]: |
| 117 | """Take a list of files/directories (with support for globbing through the glob library). |
| 118 | |
| 119 | Where a path/glob matches no file, we still include the raw path in the resulting list. |
| 120 | |
| 121 | Returns a list of file paths |
| 122 | """ |
| 123 | expanded_paths = [] |
| 124 | |
| 125 | for path in paths: |
| 126 | path = expand_path(path.strip()) |
| 127 | globbed_files = fileglob.glob(path, recursive=True) |
| 128 | if globbed_files: |
| 129 | expanded_paths.extend(globbed_files) |
| 130 | else: |
| 131 | expanded_paths.append(path) |
| 132 | |
| 133 | return expanded_paths |
| 134 | |
| 135 | |
| 136 | def split_and_match_files(paths: str) -> list[str]: |
no test coverage detected
searching dependent graphs…