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
default is a filter, not a backwards-looking call — --migrate now
converts both Go spellings, {{ .X | default "y" }} and {{ default "y" .X }}, to {{ X | default("y", true) }}. That second
argument makes Jinja's own filter mean what sprig's default means —
substituting for any empty value, not only an unset one — so a migrated
Taskfile renders what it always did while reading in the natural order. A Go {{ default "y" }} with no value at all now renders y, as sprig does,
instead of failing.
Breaking: the sprig-ordered default(fallback, value) function is gone.
A Taskfile written or migrated against 4.1.0 / 4.1.1 that calls it now fails
with unknown function; write the value first and add , true — X | default("y", true).
trunc and regexReplaceAll work as filters — s | trunc(n) and s | regexReplaceAll(pattern, repl), so a Jinja Taskfile no longer has to
spell either as a sprig-ordered call. The functions keep working as before,
and a Go Taskfile's {{ .P | trunc 3 }}, which used to fail to render, now
works and migrates to {{ P | trunc(3) }}.
A file's template dialect now covers the vars: it passes to an includes: entry and the caches: models it defines. A tree partway
through --migrate works: the migrated file no longer fails on its own
include vars, and a not-yet-migrated task no longer fails on the cache URL it
inherits. A file that declares one dialect but writes those in the other used
to be read as Go regardless, and now errors — run task --migrate on it.