Originally created by @netvl on GitHub (Apr 10, 2024).
Currently, evaluation of a Pkl module with multi-file output ignores the output format parameter for the pkl eval call (or the outputFormat property in case of the Gradle plugin). For example (snippet taken from the docs):
// birds.pkl
pigeon {
name = "Pigeon"
diet = "Seeds"
}
parrot {
name = "Parrot"
diet = "Seeds"
}
output {
files {
["birds/pigeon.out"] {
value = pigeon
}
["birds/parrot.out"] {
value = parrot
}
}
}
This is different from the regular single-file output mode, where -f would determine the default renderer in case it is not explicitly specified.
It would probably make sense for the -f argument to be honored for multi-file output as well, in the same way as for single-file output - by determining the output format in case an explicit renderer is not defined.
Originally created by @netvl on GitHub (Apr 10, 2024).
Currently, evaluation of a Pkl module with multi-file output ignores the output format parameter for the `pkl eval` call (or the `outputFormat` property in case of the Gradle plugin). For example (snippet taken from the [docs](https://pkl-lang.org/main/current/language-reference/index.html#multiple-file-output)):
```pkl
// birds.pkl
pigeon {
name = "Pigeon"
diet = "Seeds"
}
parrot {
name = "Parrot"
diet = "Seeds"
}
output {
files {
["birds/pigeon.out"] {
value = pigeon
}
["birds/parrot.out"] {
value = parrot
}
}
}
```
```
> pkl eval -m output/ -f yaml birds.pkl
output/birds/pigeon.out
output/birds/parrot.out
> cat output/birds/parrot.out
name = "Parrot"
diet = "Seeds"
> cat output/birds/pigeon.out
name = "Pigeon"
diet = "Seeds"
```
This is different from the regular single-file output mode, where `-f` would determine the default renderer in case it is not explicitly specified.
It would probably make sense for the `-f` argument to be honored for multi-file output as well, in the same way as for single-file output - by determining the output format in case an explicit renderer is not defined.
This would be a breaking change, but the breakage would be: -f previously didn't affect output, and now does.
@bioball commented on GitHub (Apr 11, 2024):
Makes sense.
This would be a breaking change, but the breakage would be: `-f` previously didn't affect output, and now does.
@StefMa commented on GitHub (Apr 11, 2024):
Is this a bug than a feature?
If I look into the CliEvaluator I see that it set the expected format:
https://github.com/apple/pkl/blob/main/pkl-cli%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fpkl%2Fcli%2FCliEvaluator.kt#L199-L203
But it seems it will not be respected 🤔
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @netvl on GitHub (Apr 10, 2024).
Currently, evaluation of a Pkl module with multi-file output ignores the output format parameter for the
pkl evalcall (or theoutputFormatproperty in case of the Gradle plugin). For example (snippet taken from the docs):This is different from the regular single-file output mode, where
-fwould determine the default renderer in case it is not explicitly specified.It would probably make sense for the
-fargument to be honored for multi-file output as well, in the same way as for single-file output - by determining the output format in case an explicit renderer is not defined.@bioball commented on GitHub (Apr 11, 2024):
Makes sense.
This would be a breaking change, but the breakage would be:
-fpreviously didn't affect output, and now does.@StefMa commented on GitHub (Apr 11, 2024):
Is this a bug than a feature?
If I look into the CliEvaluator I see that it set the expected format:
https://github.com/apple/pkl/blob/main/pkl-cli%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fpkl%2Fcli%2FCliEvaluator.kt#L199-L203
But it seems it will not be respected 🤔