feat: task arg validation#5543
Conversation
Add an optional 'choices' field to TaskArg that restricts the allowed values for a task argument. When a value is provided that is not in the choices list, a clear error message is shown. The default value, if specified, is validated against choices at parse time. Closes prefix-dev#3535
lucascolley
left a comment
There was a problem hiding this comment.
seems to work as advertised, nice!
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
ruben-arts
left a comment
There was a problem hiding this comment.
I like the idea, it could get some more UX improvements.
I think this picture summarizes it:
I would like the original no value to already present me with the choices and missing args.
I would like the second one to be more friendly. e.g.
Error: got x for 'args', choose from: ["hoi", "hi", "Hello World!"]
Some coloring would also help too.
In the future I would love this to be a interactive dialog where the selection comes up like the env selection does.
This makes sense to me, will check it out |
|
@ruben-arts the current state should reflect your expectations (minus the interactivity) |
ruben-arts
left a comment
There was a problem hiding this comment.
Thanks this looks good now
Description
Fixes #3535
How Has This Been Tested?
Local installation
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.