MCPcopy Create free account
hub / github.com/Qinbf/groundmap / collect_files

Function collect_files

scripts/convert.py:136–151  ·  view source on GitHub ↗

收集目录下所有待处理的文件,跳过派生产物(*.outline.json / *.outline.md)。

(scan_dir: Path, extensions: set[str] | None)

Source from the content-addressed store, hash-verified

134
135
136def collect_files(scan_dir: Path, extensions: set[str] | None) -> list[Path]:
137 """收集目录下所有待处理的文件,跳过派生产物(*.outline.json / *.outline.md)。"""
138 allowed = extensions if extensions else SUPPORTED_EXTENSIONS
139 files = []
140 for file_path in sorted(scan_dir.rglob("*")):
141 if not file_path.is_file():
142 continue
143 if file_path.suffix.lower() not in allowed:
144 continue
145 if file_path.name == ".gitkeep":
146 continue
147 # 跳过 convert.py 自己的派生产物(避免被再次处理)
148 if file_path.stem.lower().endswith(".outline"):
149 continue
150 files.append(file_path)
151 return files
152
153
154# doc_path 的相对基准:默认项目根;--workspace 模式下由 main() 设为该 workspace 根,

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected