Drone YAML formatting hard to read

The new drone cli releases have changed something related to the yaml formatting while using, e.g. drone jsonnet --stream --format. The resulting YAML file has alphabetic ordered keys and all empty lines removed, which makes it pretty hard to read and a bit useless.

I’m using the local conversion a lot, as it makes debugging of complex starlark or jsonnet files much easier in some situations. Was this change intended?

please see Drone fmt deprecated?

That means the --format flag for the starlark/jsonnet command is also deprecated? I mean those formats are officially supported, why not support the yaml conversion for those two? Or do I misunderstand the issue?

We deprecated the pretty print package [1] used to custom format the yaml files. This package was used by both the format command [2] and the starlark command [3] to pretty print docker pipelines (it could not pretty print other pipeline types). When pretty printing was deprecated it was replaced with a generic yaml formatter [4].

[1] https://github.com/drone/drone-yaml/tree/master/yaml/pretty
[2] https://github.com/drone/drone-cli/blob/v1.3.0/drone/starlark/starlark.go#L231
[3] https://github.com/drone/drone-cli/blob/v1.3.0/drone/format/format.go#L40
[4] https://github.com/ghodss/yaml

1 Like