treefmt
treefmt copied to clipboard
`cue fmt` always writes to the files
Describe the bug
cue fmt doesn't respect the treefmt spec and writes to the file, even if no changes occurred in the formatting.
To Reproduce
Run cue fmt somefile.cue && stat somefile.cue twice and see that the timestamp has changed twice.
Expected behavior
No change.
Additional context
This seems to be a known issue with Cue already: https://github.com/cue-lang/cue/issues/363
I wanted to fix upstream but at the point where the config is written back, the code has only an AST available. I think the AST would have to somehow be extended to carry a "modified" flag.