Skip to content

fix: implement dynamic template loader for include functionality - #14

Merged
bordeux merged 3 commits into
masterfrom
feature/fix-include-problem
Dec 31, 2025
Merged

fix: implement dynamic template loader for include functionality#14
bordeux merged 3 commits into
masterfrom
feature/fix-include-problem

Conversation

@bordeux

@bordeux bordeux commented Dec 31, 2025

Copy link
Copy Markdown
Owner
  • Add 'loader' feature to minijinja dependency for dynamic template loading
  • Implement lazy template loader using env.set_loader() in renderer
  • Template loader uses TemplateContext to resolve relative paths
  • Security: blocks absolute paths and parent traversal unless --trust mode
  • Add comprehensive test suite with 12 integration tests covering:
    • Basic include functionality
    • Nested includes (multiple levels)
    • Include from subdirectories
    • Environment variables in included templates
    • Security restrictions (parent directory and absolute path blocking)
    • Trust mode allowing parent directory access
    • Conditional includes
    • Error handling for missing templates
  • Add test fixtures for include templates and expected outputs
  • All 267 tests passing (251 unit + 12 integration + 4 doc tests)

bordeux and others added 2 commits December 31, 2025 11:29
- Add 'loader' feature to minijinja dependency for dynamic template loading
- Implement lazy template loader using env.set_loader() in renderer
- Template loader uses TemplateContext to resolve relative paths
- Security: blocks absolute paths and parent traversal unless --trust mode
- Add comprehensive test suite with 12 integration tests covering:
  * Basic include functionality
  * Nested includes (multiple levels)
  * Include from subdirectories
  * Environment variables in included templates
  * Security restrictions (parent directory and absolute path blocking)
  * Trust mode allowing parent directory access
  * Conditional includes
  * Error handling for missing templates
- Add test fixtures for include templates and expected outputs
- All 267 tests passing (251 unit + 12 integration + 4 doc tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 31, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.91%. Comparing base (3e2e61d) to head (989feba).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #14      +/-   ##
==========================================
+ Coverage   86.51%   86.91%   +0.39%     
==========================================
  Files          15       15              
  Lines         497      512      +15     
==========================================
+ Hits          430      445      +15     
  Misses         67       67              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Replace Tera references with MiniJinja throughout README
- Update template engine description to mention Jinja2 compatibility
- Update documentation links to point to MiniJinja and Jinja2 docs
- Change "Full Tera Syntax" to "Full Jinja2 Syntax" in features

MiniJinja is the new template engine as documented in MINIJINJA_MIGRATION.md.
It provides better Jinja2 compatibility and smaller binary size.
@bordeux
bordeux merged commit 774c092 into master Dec 31, 2025
9 checks passed
@bordeux
bordeux deleted the feature/fix-include-problem branch December 31, 2025 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant