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

Function _replacement

ci/meson/path_normalization.py:133–144  ·  view source on GitHub ↗
(match: re.Match[str])

Source from the content-addressed store, hash-verified

131 changed_any = False
132
133 def _replacement(match: re.Match[str]) -> str:
134 prefix, raw_path, suffix = match.groups()
135 normalized = raw_path.replace("\\", "/")
136 if _is_forward_slash_absolute(normalized) and not _has_dot_components(
137 normalized
138 ):
139 absolute = normalized
140 else:
141 absolute = (build_dir / normalized).resolve().as_posix()
142 if absolute == raw_path:
143 return match.group(0)
144 return f"{prefix}{absolute}{suffix}"
145
146 def _normalize_text(content: str) -> str:
147 return _STRICT_PATH_FLAG_RE.sub(_replacement, content)

Callers

nothing calls this directly

Calls 3

_has_dot_componentsFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected