You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Smarty (.tpl) templates as a recognized file type #1060
.tpl files (Smarty templates) are not in graphify's file-type map, so they're skipped entirely during graph builds.
In graphify/detect.py, classify_file() matches a file's extension against CODE_EXTENSIONS, DOC_EXTENSIONS, PAPER_EXTENSIONS, IMAGE_EXTENSIONS, etc. .tpl is in none of them, so classify_file() returns None and the file is never ingested — no AST pass, no semantic pass.
Why it matters
Smarty is a very common PHP templating engine (and .tpl is also used by other template systems). In template-heavy PHP codebases, .tpl files can be a large fraction of the project. For example, the repo I'm running graphify on has 261 .tpl files — roughly half the codebase — all silently omitted from the graph. The resulting graph misses the entire view layer: which controllers render which templates, {include file="..."} relationships, and the variables passed via $tpl->assign(...) / consumed as {$var}.
Suggested fix
Smarty has no tree-sitter grammar, so AST extraction isn't applicable. The natural fit is the document/semantic path. The minimal change is to add .tpl to DOC_EXTENSIONS so templates go through semantic LLM extraction:
That alone makes templates first-class documents in the graph. As a follow-up, a lightweight regex extractor (similar to the existing Blade extractor in extract.py) could capture Smarty {include file=...} / {extends ...} edges and $smarty.* / assigned-variable usage for richer code↔view links.
Current workaround
I'm patching the installed package's DOC_EXTENSIONS from a wrapper script (idempotently, so it survives uv tool upgrade), but native support would be much better.
Environment
graphify CLI 0.8.22 (PyPI graphifyy), installed via uv tool install
Activity