Skip to main content

Module variables

Module variables 

Source
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§

TemplateContext
Context for template variable substitution
TemplateValidation
Result of template validation

Enums§

TemplateWarning
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