Files
graphify/tests/test_detect_jinja.py
nikhil2004 22124ba76d fix(detect): classify Jinja templates as documents (#3427)
The bug:
Jinja2 templates were completely skipped by Graphify's detection phase because their extensions were not listed in the recognized document extensions. This resulted in the source for generated files being hidden from the graph.

The fix:
Added `.j2`, `.jinja`, and `.jinja2` to the `DOC_EXTENSIONS` set in `graphify/detect.py`.

Tests:
`tests/test_detect_jinja.py` added to verify the newly added Jinja extensions are accurately recognized as documents. This ensures the bug does not regress in future updates.

(cherry picked from commit 61f6a40a56)
2026-10-13 22:21:43 +01:00

7 lines
200 B
Python

from graphify.detect import DOC_EXTENSIONS
def test_jinja2_extensions_are_documents():
assert '.j2' in DOC_EXTENSIONS
assert '.jinja' in DOC_EXTENSIONS
assert '.jinja2' in DOC_EXTENSIONS