MCPcopy Create free account
hub / github.com/FastLED/FastLED / _get_namespace_path

Function _get_namespace_path

ci/lint_cpp/test_unity_build.py:198–214  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

196
197
198def _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
217def _calculate_include_depth(included_path: str, expected_prefix: str) -> int:

Callers 3

check_hierarchyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected