MCPcopy Create free account
hub / github.com/github/awesome-copilot / walk

Function walk

skills/acquire-codebase-knowledge/scripts/scan.py:211–223  ·  view source on GitHub ↗
(path: Path, depth: int)

Source from the content-addressed store, hash-verified

209 files = []
210
211 def walk(path: Path, depth: int):
212 if depth > max_depth or should_exclude(path):
213 return
214 try:
215 for item in sorted(path.iterdir()):
216 if should_exclude(item):
217 continue
218 rel_path = item.relative_to(Path.cwd())
219 files.append(str(rel_path))
220 if item.is_dir():
221 walk(item, depth + 1)
222 except (PermissionError, OSError):
223 pass
224
225 walk(Path.cwd(), 0)
226 return files[:TREE_LIMIT]

Callers 1

get_directory_treeFunction · 0.70

Calls 1

should_excludeFunction · 0.85

Tested by

no test coverage detected