Get the namespace path for a file (path after src/). Args: file_path: Path to the file src_dir: Path to the src directory Returns: Namespace path as string (e.g., "platforms/arm") or None if not in src/
(file_path: Path, src_dir: Path)
| 196 | |
| 197 | |
| 198 | def _get_namespace_path(file_path: Path, src_dir: Path) -> str | None: |
| 199 | """ |
| 200 | Get the namespace path for a file (path after src/). |
| 201 | |
| 202 | Args: |
| 203 | file_path: Path to the file |
| 204 | src_dir: Path to the src directory |
| 205 | |
| 206 | Returns: |
| 207 | Namespace path as string (e.g., "platforms/arm") or None if not in src/ |
| 208 | """ |
| 209 | try: |
| 210 | src_index = file_path.parts.index(SRC_DIR_NAME) |
| 211 | namespace_parts = file_path.parts[src_index + 1 : -1] # Exclude filename |
| 212 | return "/".join(namespace_parts) |
| 213 | except (ValueError, IndexError): |
| 214 | return None |
| 215 | |
| 216 | |
| 217 | def _calculate_include_depth(included_path: str, expected_prefix: str) -> int: |
no outgoing calls
no test coverage detected