Commit e36a61c
fix(workflows): use the bracket-aware scanner for the multi-arg filter check
Review catch: my hand-rolled `_has_top_level_comma` was quote-aware but NOT
bracket-aware, so it treated the comma inside a list literal as an argument
separator. The evaluator supports list literals, so this rejected
expressions that work on main today:
main: {{ inputs.missing | default([1, 2]) }} -> [1, 2]
with my PR: ValueError: filter 'default' used in an unsupported form
That is a breaking change, not a fix.
Drop the helper and use `_find_top_level`, the same scanner the operator
splitting already uses — it skips commas inside quotes AND inside nested
brackets. Verified:
default([1, 2]) -> [1, 2] (restored)
default([1,2]) -> [1, 2] (restored)
default([]) -> [] (restored)
join(", ") / default("a, b") -> unchanged
default(1, 2) -> rejected (the actual bug)
join(",", "extra") -> rejected
default([1,2], 3) -> rejected (real 2nd arg after a literal)
Dict literals resolve to None both before and after, matching main.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 7f16c1f commit e36a61c
2 files changed
Lines changed: 36 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 369 | | |
389 | 370 | | |
390 | 371 | | |
| |||
426 | 407 | | |
427 | 408 | | |
428 | 409 | | |
429 | | - | |
430 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
431 | 418 | | |
432 | 419 | | |
433 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | | - | |
741 | | - | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
742 | 748 | | |
743 | 749 | | |
744 | 750 | | |
| |||
750 | 756 | | |
751 | 757 | | |
752 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
753 | 778 | | |
754 | 779 | | |
755 | 780 | | |
| |||
0 commit comments