-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent treefmt behavior with just: Intermittent file change reporting #365
Comments
Thanks for the reproducer @willbush, I'll try to have a look in the next couple days. FYI |
This could be an issue with the |
I followed the steps to reproduce and this is what I found.
This was me manually running the command, with a natural second or two delay between executions as I retrieved the command from my history and hit enter. At this point, I suspected I knew how to make it happen, and I did with the following:
To better illustrate what is happening, look at this output:
Sometimes, treefmt thinks the file has changed after applying the formatter, and sometimes, it doesn't because of this change: 85ce0a2. When comparing We capture the I think this also explains what @jaen was reporting in #316. If you have a checkout, and then run The change to how we compare mod times was made to account for It would seem that the heuristic of |
In the short term, I've done the simple thing and added a wait, which sits behind a new ci flag #368 |
Sweet thanks for the fast turn around! |
That's the plan. The ci flag is useful in itself. When we figure out a better comparison heuristic the delay fudge can go away like you said. |
Describe the bug
treefmt --no-cache
using just to format ajustfile
intermittently showsformatted 1 files (1 changed)
orformatted 1 files (0 changed)
.Also noticed when making repro steps below that
treefmt
says its formatting the justfile, but nothing changes itgit status
.I first ran into this when using
nix flake check
trying to setup CI. Found this issue: numtide/treefmt-nix#156 note that usingtreefmtEval.config.build.check self
through treefmt-nix uses--no-cache
by default.Then narrowed it down to
treefmt --no-cache
andjust
.To Reproduce
Expected behavior
formatted 1 files (0 changed)
.I think. I'm not sure what the difference between changed and formatted files means.System information
The text was updated successfully, but these errors were encountered: