Skip to content

fix(alias): error on template parse failure in referenced_vars_for_config - #2299

Merged
max-sixty merged 1 commit into
mainfrom
template-parse-strict
Apr 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
template-parse-strict

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Drops the silent if let Ok(tmpl) = ... skip in referenced_vars_for_config so a syntax error in any alias step surfaces before flags are routed. Previously, a malformed template made that step contribute no names to the referenced-var set, which silently changed how --KEY=VALUE tokens bound vs. forwarded as positionals — the deferred expansion path would only surface the syntax error later, after args may have been routed wrong.

The helper now returns anyhow::Result<BTreeSet<String>>; callers in try_alias and step_alias propagate with ?. New unit test covers the error path.

Follow-up from review of #2287.

This was written by Claude Code on behalf of Maximilian

…nfig

Drops the silent `if let Ok(tmpl) = ...` skip so a syntax error in any
alias step surfaces before flags are routed, instead of being deferred
to execution time after args may have already been bound as positionals.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 8ac598f into main Apr 18, 2026
25 checks passed
@max-sixty
max-sixty deleted the template-parse-strict branch April 18, 2026 22:15
max-sixty added a commit that referenced this pull request Apr 18, 2026
PR #2299 landed on main during my merge: `referenced_vars_for_config`
now returns `anyhow::Result<BTreeSet<String>>` and surfaces template
parse errors instead of silently skipping them. The dry-run call site
in `handle_alias_dry_run` needs `?` to unwrap before extending.

Co-Authored-By: Claude <[email protected]>
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.

2 participants