I was looking into the drone fmt command in the CLI’s GitHub repo (drone-cli/format.go at master · drone/drone-cli · GitHub) but it looks like it references drone-yaml which is now archived.
Is the drone fmt command still being maintained or is it deprecated?
drone fmt command is deprecated
But why has it been deprecated?
When the fmt command was created Drone only supported a single pipeline syntax – docker pipelines – which made writing custom formatting code relatively simple, albeit tedious, work. Today, however, Drone supports many different pipeline types (kubernetes, macstadium, digitalocean, exec, etc) each of which has its own custom pipeline syntax. In addition, anyone can create their own Drone pipeline runner and define their own custom pipeline syntax . We felt the continued development of the format command for many different pipeline syntaxes, let alone third party pipeline syntaxes, was no longer tenable.
Although we have no plans to continue work on the formatter, the code is open source and developers could choose to carry the torch and author a tool to format yaml files.
With all that being said, if we ever come up with a more generic way to format pipelines without having to rollout hand-written formatters for every pipeline syntax, we would definitely consider adding this functionality back to the official command line tools.
While I can understand your position on reformatting a config, I was using
drone fmt to allow us to see how drone would actually parse our yaml configs. This is especially important with extensive use of yaml anchors and aliases and overriding values. I recently discovered that the go yaml parser parses the config differently than the python yaml parser when it comes to overriding dict elements. Is there a way to see the final rendered config as drone has parsed it? And if not… perhaps something could be added to just dump out the rendered config in json?