Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify availability of user vars in templates #121

Open
ckreibich opened this issue Oct 13, 2021 · 1 comment
Open

Simplify availability of user vars in templates #121

ckreibich opened this issue Oct 13, 2021 · 1 comment

Comments

@ckreibich
Copy link
Member

zkg currently warns when a user var that a template feature declares required is not available, but then continues. The validation methods in the features currently check that values are actually present and non-empty, but they don't really need to — the fact that features already declared them required is enough.

We can simplify this by aborting where we currently warn. That means the validation code only has to do the kind of validation that's actually interesting, such as checking for a particular type, formatting, etc.

We can also simplify how the templating code currently derives substitution parameters from user vars: when a user var directly translates into a param, that can be done by default — no need for templates to do this explicitly.

@ckreibich
Copy link
Member Author

@bbannier, fyi — the first part of this is based directly on the comment in your Spicy template. I noticed the same thing today when I tweaked templates for the first time in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant