MCPcopy Index your code
hub / github.com/python/mypy / split_and_match_files_list

Function split_and_match_files_list

mypy/config_parser.py:116–133  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

114
115
116def 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
136def split_and_match_files(paths: str) -> list[str]:

Callers 2

split_and_match_filesFunction · 0.85
config_parser.pyFile · 0.85

Calls 4

expand_pathFunction · 0.85
stripMethod · 0.80
extendMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…