Strip the monorepo subpath and drop generated/non-source paths.
(p: str)
| 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 |