-
Notifications
You must be signed in to change notification settings - Fork 70
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
base/v0_2: add sugar to embed Resource from a local file #99
Conversation
We can just add translateResource to the parent.
They have an unused error return right now. Convert them to returning a Report.
We'll need these when tr.Translate() starts returning multiple values.
Custom translators might fail if they're doing something at runtime that can't be checked during the validation pass, e.g. reading from an external file. Have custom translators return a Report, and plumb it through to translate.Translate().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks sane, I only have a minor options-plumbing doubt.
Have NewTranslator() take an options interface{}, and pass it to any custom translators registered against that translator. Ensure that all such custom translators take an options argument with a compatible type. Embed a base options struct in common.TranslateOptions and pass it to the translators.
If `local` is specified instead of `source` or `inline`, read a local file from a base directory and encode it into a data URI. We require the base directory to be specified on the command line, so that transpiling untrusted configs doesn't leak information from the host system by default.
Extend base verifyTranslations() to ensure that all listed exceptions are actually present.
Updated. |
Hi! /J |
@joyartoun Hopefully within the next couple weeks. |
The token `local` has been available since coreos/butane#99 but the documentation did not reflect that.
If
local
is specified instead ofsource
orinline
, read a local file from a base directory and encode it into a data URI. We require the base directory to be specified on the command line, so that transpiling untrusted configs doesn't leak information from the host system by default.This required plumbing an options struct into custom translators, and plumbing error returns (via a
report.Report
) back out.Fixes #83.