-
Notifications
You must be signed in to change notification settings - Fork 1
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
Template file extension #40
Conversation
abee627
to
9c99b12
Compare
I was wondering the case where for example |
Oof :D that's a good point, and yeah that should be a viable workaround. It's not very nice though, I wonder if some other sort of "filename escaping" would be better, like |
Yeah, I agree that it is then misleading if all of the files are not rendered |
Should there be a "NOP-engine" that gets all the non-template files? |
Or is it just something what happens before |
I found another way in which this is a problematic design. This is demonstrated by TestRecipeRenderChecksums: it uses That makes me think if the big picture here isn't "skip templating", but actually that recipes should be able to have many different types of files all processed with different engines -- one of which is gotpl and uses the |
Interesting idea that there could be multiple engines in use at the same time |
889fc63
to
51d9442
Compare
774e0e0
to
516f44f
Compare
af8c200
to
5ef172a
Compare
dcef748
to
cd01f4a
Compare
ac6aa39
to
fbb5670
Compare
Setting this to a non-empty value would cause only recipe files that end with this extension get templated (maybe validate that it is either empty or starts with a single period).
The engine was ever explicitly set in testing, otherwise it always used the default `engine.Engine{}`. It also then introduces a possible runtime error if the engine was not set for some reason. This change would make that a compile time error instead.
The default suffix is the empty string so it always matches.
5ef172a
to
e5703a8
Compare
Alright, I exploded everything and did another version :D In this version the determination of whether to use templating is not is not with the engine but with the recipe. This circumvents the problem with |
Co-authored-by: Antti Kivimäki <[email protected]> fixup: fix new extension validation check
648e748
to
36823a6
Compare
Eh, here I was rebasing and force pushing and forgot that we always squash anyway 🤦🏻 |
This PR changes template rendering such that only template files that end in ".tmpl" get run through the template engine. Other files in the templates directory get rendered as-is.
Not sure if it would be worth it to also rename the "templates" directory to something else since it will now also contain non-templated things?
Closes #39.