Open paul opened 1 month ago
Hi @paul 👋
Thanks for your input, I appreciate it.
I don't use neovim (or alike), so I may not entirely understand what's going on there. 🙃
Your idea is to add another way to feed in the YAML data, STDIN instead of reading from a file, and then write the result (the processed YAML) to STDOUT, is that right?
@lxxxvi Yes, exactly. Similar to how rubocop has a --stdin
flag: https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags
Most editors can invoke an external command to format a file, but they don't expect the file to change out from under them.
The simplest would be to support a
--stdin
flag, that would read the file in stdin, and output the formatted file to stdout.FWIW, I was able to get it to work with Neovim & conform.vim using the tempfile feature. I'm not sure how many other editors make that possible, though.