-
Is it currently possible to make For example, in this example in the docs, instead of having to reference
Thanks for the great project! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you can achieve reusability of validators using Jinja macros: https://copier.readthedocs.io/en/stable/configuring/#importing-jinja-templates-and-macros See the example in this section that uses a macro for a default value. You should be able to use a macro in a similar way for a validator. WDYT? |
Beta Was this translation helpful? Give feedback.
That's right. But it makes validator reuse more flexible, e.g. when you have a parametrized validator or one that needs more than just the answer to the question for which you're setting the validator. For instance:
If you find the long line too verbose, you may use a multiline YAML string like this (at least it's more readable IMO):