Closed kjeremy closed 2 months ago
If you pass -v
or -vv
it should log the offending file. I agree though, maybe that should be getting logged at warn or error level instead so it gets logged regardless of the verbosity level.
❯ fmt --fail-on-change
ERRO format: file has changed path=.github/dependabot.yml prev_size=133 prev_mod_time="2024-08-13 20:35:31 +0100 IST" current_size=128 current_mod_time="2024-08-13 20:37:09 +0100 IST"
ERRO format: file has changed path=.github/settings.yml prev_size=5765 prev_mod_time="2024-08-13 20:35:31 +0100 IST" current_size=5760 current_mod_time="2024-08-13 20:37:09 +0100 IST"
treefmt: error: unexpected changes detected, --fail-on-change is enabled
Is your feature request related to a problem? Please describe.
I would like
--fail-on-change
to tell me which files failed the check.Describe the solution you'd like
Instead of saying
treefmt: error: unexpected changes detected, --fail-on-change is enabled
it should say something like:Describe alternatives you've considered
Additional context
I am trying to run this in a CI pipeline where it would be useful to see where formatting is failing.