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

Function _class_theme_graph

tests/test_affected_cli.py:454–472  ·  view source on GitHub ↗
(tmp_path, with_css: bool)

Source from the content-addressed store, hash-verified

452
453
454def _class_theme_graph(tmp_path, with_css: bool):
455 from graphify.build import build_from_json
456 from graphify.extract import extract
457
458 root = tmp_path / ("with" if with_css else "without")
459 files = {
460 "layout/theme.liquid": "{{ content_for_layout }}\n",
461 "sections/main.liquid": "{% render 'card' %}\n<div class=\"btn\"></div>\n",
462 "snippets/card.liquid": "<a class=\"btn\"></a>\n{% stylesheet %}\n.card-x { color: red }\n{% endstylesheet %}\n",
463 "snippets/other.liquid": "<i class=\"btn card-x\"></i>\n",
464 }
465 if with_css:
466 files["assets/base.css"] = ".btn { color: red }\n"
467 for rel, text in files.items():
468 p = root / rel
469 p.parent.mkdir(parents=True, exist_ok=True)
470 p.write_text(text, encoding="utf-8")
471 paths = sorted(p for p in root.rglob("*") if p.suffix in {".liquid", ".css"})
472 return build_from_json(extract(paths, cache_root=root, root=root, parallel=False), directed=True)
473
474
475def _affected_sources(graph, label: str) -> set[str]:

Calls 3

build_from_jsonFunction · 0.90
extractFunction · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected