ytt
ytt copied to clipboard
confusing error message when overlay/match expects is not quoted
---
id: 1
type: book
modified: false
---
id: 2
type: book
modified: false
---
id: 3
type: course
modified: false
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.all, expects=1+
---
modified: true
Gives you the error message
- got ')', want primary expression
match-subset-docs.yml:2 | #@overlay/match by=overlay.all, expects=1+
What's confusing is that there isn't a ) in the annotation that I wrote.
I was hoping it would print an error saying my expects input should be quoted. Or ideally it accepts the 1+ as a valid token (ie. without the quoting)
yeah, that's an interesting one to fix. i think best we case scenario here is to figure out how to make error msg more understandable but even that would be hard.
#@overlay/match by=overlay.all, expects=1+
gets turned into something like
capture_annotation("overlay/match", by=overlay.all, expects=1+)
which in plain starlark is invalid since + operation is expecting a second operand before function brace closes.