MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / cases_a

Function cases_a

scripts/theme_gate.py:193–214  ·  view source on GitHub ↗

render/include/section calls with a literal name: (file, line, name, expected path).

(root: Path)

Source from the content-addressed store, hash-verified

191
192
193def cases_a(root: Path) -> list[tuple[str, int, str, str]]:
194 """render/include/section calls with a literal name: (file, line, name, expected path)."""
195 out: list[tuple[str, int, str, str]] = []
196 for p in _liquid_files(root):
197 text = _read(p)
198 masked = mask_inactive(text)
199 ln = _Lines(masked)
200 rel = _rel(root, p)
201 for m in _TAG.finditer(masked):
202 body = m.group(1)
203 nm = _TAG_NAME.match(body)
204 name = nm.group(1) if nm else ""
205 if name == "liquid":
206 base = m.start(1)
207 for lm in re.finditer(r"^[ \t]*(render|include|section)[ \t]+(['\"])([^'\"\n]+)\2", body, re.M):
208 out.append((rel, ln.of(base + lm.start()), lm.group(3), _expected(lm.group(1), lm.group(3))))
209 elif name in ("render", "include", "section"):
210 cm = _CALL.match(body.lstrip())
211 if cm:
212 off = m.start(1) + (len(body) - len(body.lstrip()))
213 out.append((rel, ln.of(off), cm.group(3), _expected(cm.group(1), cm.group(3))))
214 return out
215
216
217def _expected(kind: str, name: str) -> str:

Callers 2

_callersFunction · 0.85
measureFunction · 0.85

Calls 8

_liquid_filesFunction · 0.85
mask_inactiveFunction · 0.85
_LinesClass · 0.85
_expectedFunction · 0.85
ofMethod · 0.80
_readFunction · 0.70
_relFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected