kevin-hanselman / dud

A lightweight CLI tool for versioning data alongside source code and building data pipelines.
https://kevin-hanselman.github.io/dud/
BSD 3-Clause "New" or "Revised" License
183 stars 8 forks source link

Don't mess with yaml formatting while checksumming #163

Closed indigoviolet closed 5 months ago

indigoviolet commented 1 year ago

Is your feature request related to a problem? Please describe. If I add comments or nicely format my command for readability, it is lost upon dud commit

Describe the solution you'd like Maintain the formatting through dud commit

kevin-hanselman commented 1 year ago

I agree that this is annoying. Unfortunately solving it is non-trivial. Best case scenario, I upgrade to yaml.v3 which allegedly supports this, albeit with a big caveat:

It's worth noting that although Node offers access into details such as line numbers, colums (sp), and comments, the content when re-encoded will not have its original textual representation preserved. An effort is made to render the data plesantly (sp), and to preserve comments near the data they describe, though.

Worst case scenario, I roll my own "checksum injector", which I don't think would be worth the burden.

I think trying yaml.v3 makes sense as a next step. Thanks for opening the issue!

kevin-hanselman commented 5 months ago

For now I am closing this as unplanned for the reasons I lay out above. I am not ruling it out entirely, though! If someone thinks there's a sensible way to do this, please let me know in this thread.