Expand description
Template variable substitution for dynamic task fields.
Responsibilities:
- Define supported template variables ({{target}}, {{module}}, {{file}}, {{branch}}).
- Substitute variables in template strings with context-aware values.
- Auto-detect context from git and filesystem.
- Validate templates and report warnings for unknown variables.
Not handled here:
- Template loading (see
loader.rs). - Template merging (see
merge.rs).
Invariants/assumptions:
- Variable syntax is {{variable_name}}.
- Unknown variables are left as-is by default (not an error).
- Use strict mode to fail on unknown variables.
Structs§
- Template
Context - Context for template variable substitution
- Template
Validation - Result of template validation
Enums§
- Template
Warning - Warning types for template validation
Functions§
- detect_
context - Detect context from target path and git repository (legacy, ignores warnings)
- detect_
context_ with_ warnings - Detect context from target path and git repository
- substitute_
variables - Substitute variables in a template string
- substitute_
variables_ in_ task - Substitute variables in all string fields of a Task
- validate_
task_ template - Validate a template task and collect warnings