dtolnay/serde-yaml

Allow the indentation character to be customized

Opened this issue · 0 comments

Hello, I'm working on a feature where we inherit settings from .editorconfig to determine the pretty formatting options when writing JSON/YAML. Here's an example of this working here: https://github.com/moonrepo/moon/pull/446/files#diff-eecbfd85b3348b94eb93e82dc28debcfbaca9a8e9664c43635a8ce5eecf613e9R97

This is super easy with serde_json, as we can simply use this: https://docs.rs/serde_json/latest/serde_json/ser/struct.PrettyFormatter.html#method.with_indent

However, with serde_yaml, there doesn't seem to be a way to change the pretty settings, or indentation. I briefly dug into the source code, but this looks to be abstracted away via the libyaml crate? Regardless, it would be nice if custom indentation would be supported, both spaces and tabs.

Cheers!