Closed felschr closed 6 months ago
I guess it's worth noting that in my use case I always keep running into errors when running treefmt --no-cache --fail-on-change
due to the changed mtime.
Theoretically this issue could also be fixed by treefmt ignoring timestamp changes as part of the --fail-on-change
logic.
Git itself doesn't track file timestamps, so it's not an issue for most people, I'd assume.
Not sure if this is a good solution, but it would make treefmt compatible with a lot more formatters. E.g. I've also noticed this behaviour with buf lint
& but format
(they have other incompatibilities with the formatter spec, but they can easily be resolved with a wrapper script).
Related: #99
/cc @Ruixi-rebirth that added the formatter
Just ran into this myself. I'll see if I can open a ticket upstream if it was not done already
Released as part of https://github.com/google/yamlfmt/releases/tag/v0.12.0
Seems to be fixed for me and recently released 24.05-packages already include v0.12.1
Describe the bug
Running yamlfmt always sets the mtime to the current date even if the contents didn't change.
To Reproduce
Add some yaml files to the workspace and observe the mtime each time
treefmt --no-cache
is run.Expected behavior
treefmt-nix should not support yamlfmt since it changes mtime and thus doesn't comply with idempotence requirement of the formatter specification.
Additionally it would be nice to have a list on https://numtide.github.io/treefmt/formatters/ with known unsupported formatters and their reasons for not being supported.
System information