MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / _normalize

Function _normalize

codewiki/mcp/tools/analysis.py:139–149  ·  view source on GitHub ↗

Strip the monorepo subpath and drop generated/non-source paths.

(p: str)

Source from the content-addressed store, hash-verified

137 output_dir_rel = ""
138 except (ValueError, TypeError):
139 pass
140
141 def _normalize(p: str) -> str | None:
142 """Strip the monorepo subpath and drop generated/non-source paths."""
143 if subpath:
144 if not p.startswith(subpath + "/"):
145 return None # outside target subdirectory
146 p = p[len(subpath) + 1 :]
147 if p.startswith(".codewiki/"):
148 return None
149 if output_dir_rel and (p == output_dir_rel or p.startswith(output_dir_rel + "/")):
150 return None
151 return p
152

Callers 1

_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected