deno icon indicating copy to clipboard operation
deno copied to clipboard

Deno fmt for yml files

Open razzeee opened this issue 4 years ago • 7 comments

Would that be something worth considering?

razzeee avatar Sep 25 '21 01:09 razzeee

CC @dsherret what's the complexity of potential solution? Does dprint provide Rust implementation of YAML formatter?

bartlomieju avatar Oct 05 '21 14:10 bartlomieju

It would be a lot of work. I don't see a yaml parser for rust that supports parsing comments and getting spans/ranges of the text.

dsherret avatar Oct 09 '21 17:10 dsherret

Wouldn't https://github.com/ikatyang/tree-sitter-yaml work?

razzeee avatar Oct 09 '21 19:10 razzeee

That looks like it has the functionality, but we'd want to use a rust parser distributed over crates.io.

dsherret avatar Oct 09 '21 19:10 dsherret

Agreed, it's fairly simple to let tree-sitter build rust bindings from that (with the latest tree-sitter-cli version). And I have scripts for automatically releasing that to crates.io, but that should be done upstream, so I've opened an issue there.

razzeee avatar Oct 09 '21 20:10 razzeee

Would love this, it's literally the only reason I still have a .prettierrc.yml file in my projects.

jimisaacs avatar Mar 19 '22 17:03 jimisaacs

It looks like deno could use https://github.com/g-plane/pretty_yaml for this.

dsherret avatar Jul 11 '24 04:07 dsherret