feature: support adding comments
Currently there isn't any method to add or update comments in a yaml file.
Usecase: we currently use a script to update dependencies in our flutter projects, We also want to append comments to it showcasing that it's AutoGenerated and should not be modified by hand. https://github.com/invertase/melos/issues/692
A similar approach is being used in Flutter repo: https://github.com/flutter/flutter/blob/master/packages/flutter/pubspec.yaml#L33-L49
I think this could cool, maybe just adding comment at the end of line for keys in a map.
But even this is really hard to express.
What happens if a map is flow mode, instead of blockmode? What if there is already a comment there?
To be clear, if someone wants to work on this, I'd be happy to help with reviews. I think should could be a really cool feature to have.
But it's also a feature that would need limitations and LOTS of tests :rofl: