treefmt-nix icon indicating copy to clipboard operation
treefmt-nix copied to clipboard

fish_indent broken on 24.11

Open nicdumz opened this issue 6 months ago • 2 comments

@terlar I have the impression that 911f096b1ce16176aa77d6e64f462169a5065e00 broke for stable nix users.

Symptoms look like:

2025/06/12 04:56:04 INFO using config file: /nix/store/wksa5bxnzq02gbqs4yg4xkmf62mb420j-treefmt.toml
ERRO file has changed path=nix/modules/home/cli/fish/up-or-search.fish prev_size=465 prev_mod_time="1970-01-01 00:00:01 +0000 UTC" current_size=465 current_mod_time="2025-06-12 04:56:04 +0000 UTC"
traversed 4 files
emitted 4 files for processing

I believe that what happens is that the fish (https://fishshell.com/docs/current/cmds/fish_indent.html) is being called on stable, and fish_indent --write always unconditionally writes fish files, even when they don't need reindents.

This causes git-hooks to abort checks due to mod time changes.

nicdumz avatar Jun 14 '25 09:06 nicdumz

Which fish version is used and which NixOS release?

It was fixed here: https://github.com/fish-shell/fish-shell/issues/10616

And on release-25.05 it is 4.02 which should include the fix.

https://github.com/fish-shell/fish-shell/blob/Integration_4.0.2/src/bin/fish_indent.rs#L976

terlar avatar Jun 14 '25 09:06 terlar

Thanks, you're right, 25.05 is now out.

Things are broken on 24.11, which means that anyone not upgraded to 25.05 yet is broken.

(my repo was somewhat stuck since that March commit, automatic upgrades failing, due to git hooks failing since).

nicdumz avatar Jun 14 '25 10:06 nicdumz